From e47a181278eaa7c422eacbc24aca3cdb86b8453e Mon Sep 17 00:00:00 2001 From: tvillegas98 Date: Wed, 4 Dec 2024 18:15:20 -0300 Subject: [PATCH] fix: players positions were being applied after every kill --- apps/arena/lib/arena/game_updater.ex | 7 ++++++- apps/arena/lib/arena/matchmaking/deathmatch_mode.ex | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/arena/lib/arena/game_updater.ex b/apps/arena/lib/arena/game_updater.ex index 0eaba6682..53acff9d8 100644 --- a/apps/arena/lib/arena/game_updater.ex +++ b/apps/arena/lib/arena/game_updater.ex @@ -555,7 +555,12 @@ defmodule Arena.GameUpdater do |> update_in([:killfeed], fn killfeed -> [entry | killfeed] end) |> maybe_add_kill_to_player(killer_id) |> grant_power_up_to_killer(game_config, killer_id, victim_id) - |> put_player_position(victim_id) + + game_state = if game_config.game.game_mode != :DEATHMATCH do + put_player_position(game_state, victim_id) + else + game_state + end broadcast_player_dead(state.game_state.game_id, victim_id) diff --git a/apps/arena/lib/arena/matchmaking/deathmatch_mode.ex b/apps/arena/lib/arena/matchmaking/deathmatch_mode.ex index 91f7dd4ac..8278f8119 100644 --- a/apps/arena/lib/arena/matchmaking/deathmatch_mode.ex +++ b/apps/arena/lib/arena/matchmaking/deathmatch_mode.ex @@ -7,7 +7,7 @@ defmodule Arena.Matchmaking.DeathmatchMode do # 3 Mins # TODO: add this to the configurator https://github.com/lambdaclass/mirra_backend/issues/985 - @match_duration 180_000 + @match_duration 20_000 @respawn_time 5000 # Time to wait to start game with any amount of clients