Skip to content

Commit

Permalink
Fix RAS weapon range in target_ui (cataclysmbnteam#2933)
Browse files Browse the repository at this point in the history
Spawn temp weapon for RAS weapons that is used to generate range.
  • Loading branch information
KheirFerrum authored Jun 3, 2023
1 parent 1ac2536 commit 8291035
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3098,7 +3098,13 @@ void target_ui::update_ammo_range_from_gun_mode()
} else {
ammo = activity->reload_loc ? activity->reload_loc.get_item()->type :
relevant->gun_current_mode().target->ammo_data();
range = relevant->gun_current_mode().target->gun_range( you );
if( activity->reload_loc ) {
item temp_weapon = *relevant;
temp_weapon.ammo_set( ammo->get_id() );
range = temp_weapon.gun_current_mode().target->gun_range( you );
} else {
range = relevant->gun_current_mode().target->gun_range( you );
}
}
}

Expand Down

0 comments on commit 8291035

Please sign in to comment.