From 6f9b310a23457813d65f12d007d97949ee669aaf Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 11 Feb 2021 16:00:49 -0700 Subject: [PATCH] fix mega trigger sprite data corruption --- src/battle_interface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index 73b66a7ff0..65c98a1873 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1516,8 +1516,11 @@ bool32 IsMegaTriggerSpriteActive(void) void HideMegaTriggerSprite(void) { - ChangeMegaTriggerSprite(gBattleStruct->mega.triggerSpriteId, 0); - gSprites[gBattleStruct->mega.triggerSpriteId].tHide = TRUE; + if (gBattleStruct->mega.triggerSpriteId != 0xFF) + { + ChangeMegaTriggerSprite(gBattleStruct->mega.triggerSpriteId, 0); + gSprites[gBattleStruct->mega.triggerSpriteId].tHide = TRUE; + } } void DestroyMegaTriggerSprite(void)