Skip to content

Commit

Permalink
Add shot counter to mods and gun (#37693)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpwb authored and ZhilkinSerg committed Mar 17, 2020
1 parent c56b01f commit c67172e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ int player::fire_gun( const tripoint &target, int shots, item &gun )
continue; // skip retargeting for launchers
}
}

// apply shot counter to gun and its mods.
gun.set_var( "shot_counter", gun.get_var( "shot_counter", 0 ) + curshot );
for( item *mod : gun.gunmods() ) {
mod->set_var( "shot_counter", mod->get_var( "shot_counter", 0 ) + curshot );
}
// apply delayed recoil
recoil += delay;
if( is_mech_weapon ) {
Expand Down

0 comments on commit c67172e

Please sign in to comment.