SpriteCB_EnemyShadow: Avoid use-after-free (#8220)
This commit is contained in:
parent
fe85da81fc
commit
2bb0d0249d
@ -1239,6 +1239,12 @@ void LoadAndCreateEnemyShadowSprites(void)
|
||||
|
||||
void SpriteCB_EnemyShadow(struct Sprite *shadowSprite)
|
||||
{
|
||||
if (gBattleSpritesDataPtr == NULL)
|
||||
{
|
||||
shadowSprite->callback = SpriteCB_SetInvisible;
|
||||
return;
|
||||
}
|
||||
|
||||
bool8 invisible = FALSE;
|
||||
u8 battler = shadowSprite->tBattlerId;
|
||||
struct Sprite *battlerSprite = &gSprites[gBattlerSpriteIds[battler]];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user