Terrains freeze the game after player mon faints (#3016)

This commit is contained in:
Alex 2023-05-20 17:10:45 +02:00 committed by GitHub
parent 9506b205e6
commit a0881b8e8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2056,6 +2056,8 @@ static bool32 EndTurnTerrain(u32 terrainFlag, u32 stringTableId)
{
if (gFieldStatuses & terrainFlag)
{
if (terrainFlag & STATUS_FIELD_GRASSY_TERRAIN)
BattleScriptExecute(BattleScript_GrassyTerrainHeals);
if (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.terrainTimer == 0)
{
gFieldStatuses &= ~terrainFlag;
@ -2065,11 +2067,9 @@ static bool32 EndTurnTerrain(u32 terrainFlag, u32 stringTableId)
gBattleCommunication[MULTISTRING_CHOOSER] = stringTableId;
BattleScriptExecute(BattleScript_TerrainEnds);
}
}
if (terrainFlag & STATUS_FIELD_GRASSY_TERRAIN)
BattleScriptExecute(BattleScript_GrassyTerrainHeals);
return TRUE;
}
}
return FALSE;
}