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 Apr 2, 2020
1 parent 058c863 commit b19ff92
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 @@ -517,7 +517,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 b19ff92

Please sign in to comment.