From b0510d78f81a00e7b88d2110339d8592007c9ed4 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 10 Oct 2022 03:16:40 -0500 Subject: [#1712] Reset fileNum when returning to title screen and prevent saving when file = 0xFF (#1721) --- soh/src/code/z_play.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'soh/src/code') 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) { -- cgit v1.2.3 From c00edb928b9c41d7fbda6e58d882e7fd9f07e884 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 10 Oct 2022 03:19:44 -0500 Subject: [#1716] Prevent infinite ammo cheat from filling bombchus unless the item is obtained (#1723) --- soh/src/code/game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'soh/src/code') 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; } } -- cgit v1.2.3 From 63f763a556cdd705ccfbb4c8bb15bb2133afc37a Mon Sep 17 00:00:00 2001 From: Rozelette Date: Tue, 11 Oct 2022 11:58:28 -0500 Subject: When testing if an animation is new, make sure we are using the loaded file pointers (#1748) --- soh/src/code/z_skelanime.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'soh/src/code') 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); -- cgit v1.2.3