Skip to content

Commit d03707d

Browse files
committed
perform recoil only once
1 parent 1e3d08f commit d03707d

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/game/detail/inventory/generate_equipment.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ entity_id requested_equipment::generate_for_impl(
4949

5050
auto recoils = perform_recoils;
5151

52-
auto transfer = [recoils, &cosm, &on_step, &max_effects_played](const auto from, const auto to, const bool play_effects = true) {
52+
auto transfer = [&recoils, &cosm, &on_step, &max_effects_played](const auto from, const auto to, const bool play_effects = true) mutable {
5353
if (to.dead()) {
5454
return;
5555
}
@@ -67,6 +67,7 @@ entity_id requested_equipment::generate_for_impl(
6767
request.params.play_transfer_sounds = max_effects_played > 0 && play_effects;
6868
request.params.play_transfer_particles = max_effects_played > 0 && play_effects;
6969
request.params.perform_recoils = recoils;
70+
recoils = false;
7071

7172
const auto result = perform_transfer_no_step(request, cosm);
7273

src/game/modes/arena_mode.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,7 @@ bool arena_mode::give_bomb_to_random_player(const input_type in, const logic_ste
919919

920920
auto request = item_slot_transfer_request::standard(spawned_bomb.get_id(), typed_player[t].get_id());
921921
request.params.bypass_mounting_requirements = true;
922+
request.params.perform_recoils = false;
922923
perform_transfer(request, step);
923924
break;
924925
}

src/view/rendering_scripts/illuminated_rendering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,11 @@ void illuminated_rendering(const illuminated_rendering_input in) {
423423
const vec2 projection_space_pos = cone.to_screen_space(world_space_pos);
424424

425425
float maximum_heat = 0.0f;
426+
maximum_heat = std::max(maximum_heat, std::abs(it.template get<components::crosshair>().recoil.rotation));
426427

427428
for (const auto& gun_id : it.get_wielded_guns())
428429
{
429430
(void)gun_id;
430-
maximum_heat = std::max(maximum_heat, std::abs(it.template get<components::crosshair>().recoil.rotation));
431431
}
432432

433433
if (settings.crosshair.type == crosshair_type::CIRCULAR) {

0 commit comments

Comments
 (0)