Skip to content

Commit

Permalink
Merge pull request #77387 from Night-Pryanik/burst-fire
Browse files Browse the repository at this point in the history
`Burst-fire wielded weapon` now actually sets wielded weapon to burst or auto firing modes
  • Loading branch information
Maleclypse authored Oct 31, 2024
2 parents 1e1ce2c + de2c7ce commit d0021ce
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ static const efftype_id effect_stunned( "stunned" );
static const flag_id json_flag_MOP( "MOP" );

static const gun_mode_id gun_mode_AUTO( "AUTO" );
static const gun_mode_id gun_mode_BURST( "BURST" );

static const itype_id fuel_type_animal( "animal" );
static const itype_id itype_radiocontrol( "radiocontrol" );
Expand Down Expand Up @@ -2612,10 +2613,8 @@ bool game::do_regular_action( action_id &act, avatar &player_character,

case ACTION_FIRE_BURST: {
if( weapon ) {
gun_mode_id original_mode = weapon->gun_get_mode_id();
if( weapon->gun_set_mode( gun_mode_AUTO ) ) {
if( weapon->gun_set_mode( gun_mode_BURST ) || weapon->gun_set_mode( gun_mode_AUTO ) ) {
avatar_action::fire_wielded_weapon( player_character );
weapon->gun_set_mode( original_mode );
}
}
break;
Expand Down

0 comments on commit d0021ce

Please sign in to comment.