mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 23:23:43 +01:00
Fix createsprite battle anim cmd not checking MAX_SPRITES
This commit is contained in:
parent
f3be4e1ac5
commit
09013ee2db
@ -525,12 +525,13 @@ static void Cmd_createsprite(void)
|
|||||||
|
|
||||||
subpriority = GetSubpriorityForMoveAnim(argVar);
|
subpriority = GetSubpriorityForMoveAnim(argVar);
|
||||||
|
|
||||||
CreateSpriteAndAnimate(
|
if (CreateSpriteAndAnimate(template,
|
||||||
template,
|
|
||||||
GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2),
|
GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2),
|
||||||
GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET),
|
GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET),
|
||||||
subpriority);
|
subpriority) != MAX_SPRITES) // Don't increment the task count if the sprite couldn't be created(i.e. there are too many created sprites atm).
|
||||||
|
{
|
||||||
gAnimVisualTaskCount++;
|
gAnimVisualTaskCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CreateSpriteOnTargets(const struct SpriteTemplate *template, u8 argVar, u8 battlerArgIndex, u8 argsCount, bool32 overwriteAnimTgt)
|
static void CreateSpriteOnTargets(const struct SpriteTemplate *template, u8 argVar, u8 battlerArgIndex, u8 argsCount, bool32 overwriteAnimTgt)
|
||||||
@ -555,13 +556,14 @@ static void CreateSpriteOnTargets(const struct SpriteTemplate *template, u8 argV
|
|||||||
if (overwriteAnimTgt)
|
if (overwriteAnimTgt)
|
||||||
gBattleAnimArgs[battlerArgIndex] = targets[i];
|
gBattleAnimArgs[battlerArgIndex] = targets[i];
|
||||||
|
|
||||||
CreateSpriteAndAnimate(
|
if (CreateSpriteAndAnimate(template,
|
||||||
template,
|
|
||||||
GetBattlerSpriteCoord(targets[i], BATTLER_COORD_X_2),
|
GetBattlerSpriteCoord(targets[i], BATTLER_COORD_X_2),
|
||||||
GetBattlerSpriteCoord(targets[i], BATTLER_COORD_Y_PIC_OFFSET),
|
GetBattlerSpriteCoord(targets[i], BATTLER_COORD_Y_PIC_OFFSET),
|
||||||
subpriority);
|
subpriority) != MAX_SPRITES) // Don't increment the task count if the sprite couldn't be created(i.e. there are too many created sprites atm).
|
||||||
|
{
|
||||||
gAnimVisualTaskCount++;
|
gAnimVisualTaskCount++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// will NOT overwrite gBattleAnimArgs
|
// will NOT overwrite gBattleAnimArgs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user