From 7b4a223b67d2d903a125b7b26c020c4d79fe6121 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Thu, 9 May 2024 21:36:32 +1000 Subject: [PATCH] fixed double dynos animation swap (#32) this usually was a bug caused by mirror mario, where animInfo.curAnim was NULL, but the swap was still carried out --- data/dynos_mgr_anim.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/dynos_mgr_anim.cpp b/data/dynos_mgr_anim.cpp index 84d57f8b..bbec9b7c 100644 --- a/data/dynos_mgr_anim.cpp +++ b/data/dynos_mgr_anim.cpp @@ -47,7 +47,7 @@ void DynOS_Anim_Swap(void *aPtr) { // Does the object have a model? struct Object *_Object = (struct Object *) aPtr; - if (!_Object->header.gfx.sharedChild) { + if (!_Object->header.gfx.sharedChild || !_Object->header.gfx.animInfo.curAnim) { return; } @@ -78,6 +78,7 @@ void DynOS_Anim_Swap(void *aPtr) { if (gMarioStates[i].marioObj == NULL) { continue; } if (_Object == gMarioStates[i].marioObj) { _AnimIndex = RetrieveCurrentMarioAnimationIndex(i); + break; } } if (_AnimIndex == -1) {