summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/game.c2
-rw-r--r--soh/src/code/z_play.c2
-rw-r--r--soh/src/code/z_skelanime.c19
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);