fix: la inmunitat del jugador no funcionava
This commit is contained in:
@@ -311,16 +311,16 @@ void Game::init(int playerID)
|
||||
players[otherPlayer - 1]->enable(true);
|
||||
}
|
||||
|
||||
// Añade 0, 1 o 2 cafes al jugador 1
|
||||
for (int i = 0; i < rand() % 3; ++i)
|
||||
for (auto player : players)
|
||||
{
|
||||
players[0]->giveExtraHit();
|
||||
}
|
||||
// Añade 0, 1 o 2 cafes al jugador
|
||||
for (int i = 0; i < rand() % 3; ++i)
|
||||
{
|
||||
player->giveExtraHit();
|
||||
}
|
||||
|
||||
// Añade 0, 1 o 2 cafes al jugador 2
|
||||
for (int i = 0; i < rand() % 3; ++i)
|
||||
{
|
||||
players[1]->giveExtraHit();
|
||||
// Empieza sin inmunidad
|
||||
player->setInvulnerable(false);
|
||||
}
|
||||
|
||||
// Deshabilita los sonidos
|
||||
@@ -2453,7 +2453,7 @@ void Game::renderSmartSprites()
|
||||
// Acciones a realizar cuando el jugador muere
|
||||
void Game::killPlayer(Player *player)
|
||||
{
|
||||
if (!player->isEnabled() && player->isInvulnerable())
|
||||
if (!player->isEnabled() || player->isInvulnerable())
|
||||
{ // Si no está habilitado o tiene inmunidad, no hace nada
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user