Skip to content

Commit 07a3b86

Browse files
committed
Remove dumb gun cheese
1 parent c2983ad commit 07a3b86

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/ranged.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,13 +1300,17 @@ int Character::fire_gun( map &here, const tripoint_bub_ms &target, int shots, it
13001300
body_part_name_accusative( bodypart_id( hurt_part.first ) ) );
13011301
}
13021302

1303-
// Practice the base gun skill proportionally to number of hits, but always by one.
1304-
if( !gun.has_flag( flag_WONT_TRAIN_MARKSMANSHIP ) ) {
1305-
practice( skill_gun, ( hits + 1 ) * 5 );
1303+
// Marksmanship and gun skills only train for attacks taking place at least 2 tiles away.
1304+
// Any shots happening at point blank cannot be considered training in any sort of gun skill!
1305+
if( rl_dist( pos_bub().xy(), target.xy() ) > 1 ) {
1306+
// Practice the base gun skill proportionally to number of hits, but always by one.
1307+
if( !gun.has_flag( flag_WONT_TRAIN_MARKSMANSHIP ) ) {
1308+
practice( skill_gun, ( hits + 1 ) * 5 );
1309+
}
1310+
// launchers train weapon skill for both hits and misses.
1311+
int practice_units = gun_skill == skill_launcher ? curshot : hits;
1312+
practice( gun_skill, ( practice_units + 1 ) * 5 );
13061313
}
1307-
// launchers train weapon skill for both hits and misses.
1308-
int practice_units = gun_skill == skill_launcher ? curshot : hits;
1309-
practice( gun_skill, ( practice_units + 1 ) * 5 );
13101314

13111315
if( !gun.is_gun() ) {
13121316
// If we lose our gun as a side effect of firing it, skip the rest of the function.

0 commit comments

Comments
 (0)