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,10 +2067,8 @@ static bool32 EndTurnTerrain(u32 terrainFlag, u32 stringTableId)
gBattleCommunication[MULTISTRING_CHOOSER] = stringTableId;
BattleScriptExecute(BattleScript_TerrainEnds);
}
return TRUE;
}
if (terrainFlag & STATUS_FIELD_GRASSY_TERRAIN)
BattleScriptExecute(BattleScript_GrassyTerrainHeals);
return TRUE;
}
return FALSE;
}
@ -6807,7 +6807,7 @@ static bool32 GetMentalHerbEffect(u8 battlerId)
static u8 TryConsumeMirrorHerb(u8 battlerId, bool32 execute)
{
u8 effect = 0;
if (gProtectStructs[battlerId].eatMirrorHerb) {
gLastUsedItem = gBattleMons[battlerId].item;
gBattleScripting.savedBattler = gBattlerAttacker;