Skip to content

Commit

Permalink
remove parameter avatar from game_menus::inv::take_off
Browse files Browse the repository at this point in the history
  • Loading branch information
Brambor committed Sep 17, 2024
1 parent f8bda62 commit 309e64d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/game_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) :

Check failure on line 438 in src/game_inventory.cpp

View workflow job for this annotation

GitHub Actions / build (src)

single-argument constructors must be marked explicit to avoid unintentional implicit conversions [google-explicit-constructor,-warnings-as-errors]
armor_inventory_preset( get_avatar(), color )
{}

bool is_shown( const item_location &loc ) const override {
Expand All @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/game_inventory.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
class Character;
struct tripoint;

class avatar;
class repair_item_actor;
class salvage_actor;

Expand Down Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down

0 comments on commit 309e64d

Please sign in to comment.