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
This commit is contained in:
Isaac0-dev 2024-05-09 21:36:32 +10:00 committed by GitHub
parent a5c4e29d2f
commit 7b4a223b67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,7 @@ void DynOS_Anim_Swap(void *aPtr) {
// Does the object have a model? // Does the object have a model?
struct Object *_Object = (struct Object *) aPtr; struct Object *_Object = (struct Object *) aPtr;
if (!_Object->header.gfx.sharedChild) { if (!_Object->header.gfx.sharedChild || !_Object->header.gfx.animInfo.curAnim) {
return; return;
} }
@ -78,6 +78,7 @@ void DynOS_Anim_Swap(void *aPtr) {
if (gMarioStates[i].marioObj == NULL) { continue; } if (gMarioStates[i].marioObj == NULL) { continue; }
if (_Object == gMarioStates[i].marioObj) { if (_Object == gMarioStates[i].marioObj) {
_AnimIndex = RetrieveCurrentMarioAnimationIndex(i); _AnimIndex = RetrieveCurrentMarioAnimationIndex(i);
break;
} }
} }
if (_AnimIndex == -1) { if (_AnimIndex == -1) {