Skip to content

Commit

Permalink
Fire action accounts for all kinds of shoulder straps
Browse files Browse the repository at this point in the history
I've noticed only "adjustable strap" works with the fire action to drawn
weapon, and only with default format (hanging like backpack). Happens
that code checks for that specific item. Solution is to check for a flag
instead, and so works with all kinds of attachments
  • Loading branch information
andrewhr committed Dec 23, 2024
1 parent 0664114 commit 10210a2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/character_attire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ static const efftype_id effect_onfire( "onfire" );
static const flag_id json_flag_HIDDEN( "HIDDEN" );
static const flag_id json_flag_ONE_PER_LAYER( "ONE_PER_LAYER" );

static const itype_id itype_shoulder_strap( "shoulder_strap" );

static const material_id material_acidchitin( "acidchitin" );
static const material_id material_bone( "bone" );
static const material_id material_chitin( "chitin" );
Expand Down Expand Up @@ -2052,7 +2050,7 @@ void outfit::fire_options( Character &guy, std::vector<std::string> &options,

actions.emplace_back( [&] { guy.invoke_item( &clothing, "holster" ); } );

} else if( clothing.is_gun() && clothing.gunmod_find( itype_shoulder_strap ) ) {
} else if( clothing.is_gun() && clothing.gunmod_find_by_flag( flag_BELTED ) ) {
// wield item currently worn using shoulder strap
options.push_back( clothing.display_name() );
actions.emplace_back( [&] { guy.wield( clothing ); } );
Expand Down

0 comments on commit 10210a2

Please sign in to comment.