Implemented clear animation for also ow pokemon sprites

This commit is contained in:
lordraindance2 2024-12-17 22:13:51 -05:00
parent 99ba36b446
commit b580dec6a3

View file

@ -1007,6 +1007,11 @@ bool8 ScrCmd_applymovement(struct ScriptContext *ctx)
// When applying script movements to follower, it may have frozen animation that must be cleared
if (localId == OBJ_EVENT_ID_FOLLOWER && (objEvent = GetFollowerObject()) && objEvent->frozen)
{
goto clear_animation;
}
if ((objEvent = &gObjectEvents[GetObjectEventIdByLocalId(localId)]) && IS_OW_MON_OBJ(objEvent))
{
clear_animation:
ClearObjectEventMovement(objEvent, &gSprites[objEvent->spriteId]);
gSprites[objEvent->spriteId].animCmdIndex = 0; // Reset start frame of animation
}