From bb21191c5b4e7122275ce7d9e17b64dffc158d4e Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Thu, 21 May 2026 09:48:20 +0200 Subject: [PATCH] refactor(defaults): substitueix els 999.0F restants per HIT_TIMER_INACTIVE_PLAYER --- source/game/scenes/game_scene.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/game/scenes/game_scene.cpp b/source/game/scenes/game_scene.cpp index 9bdb281..f7cc050 100644 --- a/source/game/scenes/game_scene.cpp +++ b/source/game/scenes/game_scene.cpp @@ -201,8 +201,8 @@ void GameScene::stepMidGameJoin() { // Solo se permite join si hay al menos un jugador vivo (no se puede // hacer join en pantalla vacía). const bool ALGU_VIU = - (match_config_.jugador1_actiu && hit_timer_per_player_[0] != 999.0F) || - (match_config_.jugador2_actiu && hit_timer_per_player_[1] != 999.0F); + (match_config_.jugador1_actiu && hit_timer_per_player_[0] != Defaults::Game::HIT_TIMER_INACTIVE_PLAYER) || + (match_config_.jugador2_actiu && hit_timer_per_player_[1] != Defaults::Game::HIT_TIMER_INACTIVE_PLAYER); if (!ALGU_VIU) { return; } @@ -211,7 +211,7 @@ void GameScene::stepMidGameJoin() { for (uint8_t pid = 0; pid < 2; pid++) { const bool ACTIU = (pid == 0) ? match_config_.jugador1_actiu : match_config_.jugador2_actiu; - const bool MUERTO_SIN_VIDAS = hit_timer_per_player_[pid] == 999.0F; + const bool MUERTO_SIN_VIDAS = hit_timer_per_player_[pid] == Defaults::Game::HIT_TIMER_INACTIVE_PLAYER; if (ACTIU && !MUERTO_SIN_VIDAS) { continue; // jugador ya está jugando } @@ -284,7 +284,7 @@ auto GameScene::stepGameOver(float delta_time) -> bool { void GameScene::stepDeathSequence(float delta_time) { bool algun_mort = false; for (uint8_t i = 0; i < 2; i++) { - if (hit_timer_per_player_[i] <= 0.0F || hit_timer_per_player_[i] >= 999.0F) { + if (hit_timer_per_player_[i] <= 0.0F || hit_timer_per_player_[i] >= Defaults::Game::HIT_TIMER_INACTIVE_PLAYER) { continue; } algun_mort = true; @@ -304,7 +304,7 @@ void GameScene::stepDeathSequence(float delta_time) { } // Sin vidas: marcar definitivamente muerto y comprobar transición a CONTINUE. - hit_timer_per_player_[i] = 999.0F; + hit_timer_per_player_[i] = Defaults::Game::HIT_TIMER_INACTIVE_PLAYER; const bool P1_DEAD = !match_config_.jugador1_actiu || lives_per_player_[0] <= 0; const bool P2_DEAD = !match_config_.jugador2_actiu || lives_per_player_[1] <= 0; if (P1_DEAD && P2_DEAD) {