summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorRozelette <Rozelette@users.noreply.github.com>2022-10-11 11:58:28 -0500
committerGitHub <noreply@github.com>2022-10-11 18:58:28 +0200
commit63f763a556cdd705ccfbb4c8bb15bb2133afc37a (patch)
tree6c551974a5c5a17ff337f292319c84abc9d01cf5 /soh/src/code
parent83541f460588b6b596c813625c8d85eeeb47258b (diff)
When testing if an animation is new, make sure we are using the loaded file pointers (#1748)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_skelanime.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c
index 34e827b18..cc969be45 100644
--- a/soh/src/code/z_skelanime.c
+++ b/soh/src/code/z_skelanime.c
@@ -1242,8 +1242,12 @@ void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAn
if (ResourceMgr_OTRSigCheck(animation) != 0)
animation = ResourceMgr_LoadAnimByName(animation);
+ AnimationHeader* currentAnimation = (AnimationHeader*)skelAnime->animation;
+ if (ResourceMgr_OTRSigCheck(currentAnimation) != 0)
+ currentAnimation = ResourceMgr_LoadAnimByName(currentAnimation);
+
skelAnime->mode = mode;
- if ((morphFrames != 0.0f) && ((animation != skelAnime->animation) || (startFrame != skelAnime->curFrame))) {
+ if ((morphFrames != 0.0f) && ((animation != currentAnimation) || (startFrame != skelAnime->curFrame))) {
if (morphFrames < 0) {
LinkAnimation_SetUpdateFunction(skelAnime);
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
@@ -1687,8 +1691,17 @@ s32 SkelAnime_Once(SkelAnime* skelAnime) {
*/
void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame,
u8 mode, f32 morphFrames, s8 taper) {
+ LinkAnimationHeader* ogAnim = animation;
+
+ if (ResourceMgr_OTRSigCheck(animation) != 0)
+ animation = ResourceMgr_LoadAnimByName(animation);
+
+ AnimationHeader* currentAnimation = (AnimationHeader*)skelAnime->animation;
+ if (ResourceMgr_OTRSigCheck(currentAnimation) != 0)
+ currentAnimation = ResourceMgr_LoadAnimByName(currentAnimation);
+
skelAnime->mode = mode;
- if ((morphFrames != 0.0f) && ((animation != skelAnime->animation) || (startFrame != skelAnime->curFrame))) {
+ if ((morphFrames != 0.0f) && ((animation != currentAnimation) || (startFrame != skelAnime->curFrame))) {
if (morphFrames < 0) {
SkelAnime_SetUpdate(skelAnime);
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
@@ -1710,7 +1723,7 @@ void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32
skelAnime->morphWeight = 0.0f;
}
- skelAnime->animation = animation;
+ skelAnime->animation = ogAnim;
skelAnime->startFrame = startFrame;
skelAnime->endFrame = endFrame;
skelAnime->animLength = Animation_GetLength(animation);