refactor(defaults): substitueix els 999.0F restants per HIT_TIMER_INACTIVE_PLAYER

This commit is contained in:
2026-05-21 09:48:20 +02:00
parent 7139dea7f6
commit bb21191c5b
+5 -5
View File
@@ -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) {