From 309e64d2e28dbeba443cac04aea7c7d8645ff569 Mon Sep 17 00:00:00 2001 From: Brambor Date: Tue, 17 Sep 2024 17:14:23 +0200 Subject: [PATCH] remove parameter avatar from game_menus::inv::take_off --- src/game_inventory.cpp | 10 +++++----- src/game_inventory.h | 3 +-- src/handle_action.cpp | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/game_inventory.cpp b/src/game_inventory.cpp index 5b71a46f2bac9..218f31bc59746 100644 --- a/src/game_inventory.cpp +++ b/src/game_inventory.cpp @@ -435,8 +435,8 @@ item_location game_menus::inv::wear( Character &you, const bodypart_id &bp ) class take_off_inventory_preset: public armor_inventory_preset { public: - take_off_inventory_preset( Character &you, const std::string &color ) : - armor_inventory_preset( you, color ) + take_off_inventory_preset( const std::string &color ) : + armor_inventory_preset( get_avatar(), color ) {} bool is_shown( const item_location &loc ) const override { @@ -454,10 +454,10 @@ class take_off_inventory_preset: public armor_inventory_preset } }; -item_location game_menus::inv::take_off( avatar &you ) +item_location game_menus::inv::take_off() { - return inv_internal( you, take_off_inventory_preset( you, "color_red" ), _( "Take off item" ), 1, - _( "You're not wearing anything." ) ); + return inv_internal( get_avatar(), take_off_inventory_preset( "color_red" ), _( "Take off item" ), + 1, _( "You're not wearing anything." ) ); } item_location game::inv_map_splice( const item_filter &filter, const std::string &title, int radius, diff --git a/src/game_inventory.h b/src/game_inventory.h index 1cc3fd0bf1b0c..cc8e6ad8036fa 100644 --- a/src/game_inventory.h +++ b/src/game_inventory.h @@ -14,7 +14,6 @@ class Character; struct tripoint; -class avatar; class repair_item_actor; class salvage_actor; @@ -146,7 +145,7 @@ item_location veh_tool_attach( Character &you, const std::string &vp_name, /** Choose item to wear. */ item_location wear( Character &you, const bodypart_id &bp = bodypart_id( "bp_null" ) ); /** Choose item to take off. */ -item_location take_off( avatar &you ); +item_location take_off(); /** Item cut up menu. */ item_location salvage( Character &you, const salvage_actor *actor ); /** Repair menu. */ diff --git a/src/handle_action.cpp b/src/handle_action.cpp index 7b2f5ce2cc4fd..c9282f7476b27 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -1624,7 +1624,7 @@ static void wear() static void takeoff() { avatar &player_character = get_avatar(); - item_location loc = game_menus::inv::take_off( player_character ); + item_location loc = game_menus::inv::take_off(); if( loc ) { player_character.takeoff( loc.obtain( player_character ) );