diff options
| author | briaguya <70942617+briaguya-ai@users.noreply.github.com> | 2022-10-12 18:44:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-12 18:44:26 -0400 |
| commit | 595e105ef1f8141017ffcd240ed4ce76b4146e26 (patch) | |
| tree | d401342876e92a59f5ade5047ee06eb252452c7c /soh/src/code | |
| parent | 41bcad78a3068e8ff8d0bbccb0f2d43967831f69 (diff) | |
| parent | 6e88a3706ccb23340c95f92417036a4bd5e38d6a (diff) | |
Merge pull request #1758 from HarbourMasters/develop-zhora
zhora -> dev
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/game.c | 2 | ||||
| -rw-r--r-- | soh/src/code/z_play.c | 2 | ||||
| -rw-r--r-- | soh/src/code/z_skelanime.c | 19 |
3 files changed, 18 insertions, 5 deletions
diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 9089606e6..712bc6f2a 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -370,7 +370,7 @@ void GameState_Update(GameState* gameState) { } // Bombchus (max: 50, no upgrades) - if (AMMO(ITEM_BOMBCHU) < 50) { + if (INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU && AMMO(ITEM_BOMBCHU) < 50) { AMMO(ITEM_BOMBCHU) = 50; } } diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index f25163c5e..47a6821da 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -2006,7 +2006,7 @@ s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* pos) { } void Gameplay_PerformSave(GlobalContext* globalCtx) { - if (globalCtx != NULL) { + if (globalCtx != NULL && gSaveContext.fileNum != 0xFF) { Gameplay_SaveSceneFlags(globalCtx); gSaveContext.savedSceneNum = globalCtx->sceneNum; if (gSaveContext.temporaryWeapon) { 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); |
