summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraMannus <mannusmenting@gmail.com>2023-01-31 13:21:16 +0100
committerGitHub <noreply@github.com>2023-01-31 07:21:16 -0500
commite14fcf92d2e75eb6d0930bd63a62d23d063a3983 (patch)
tree1d62546ebe4b0ce0d971e41d26b99059c8bae626
parent612700c2ab73fbc4485ccb149eb407c07122d63a (diff)
Fix GI overruling link size over anything else (#2424)
-rw-r--r--soh/soh/Enhancements/game-interactor/GameInteractionEffect.cpp2
-rw-r--r--soh/soh/Enhancements/game-interactor/GameInteractor.h5
-rw-r--r--soh/soh/Enhancements/game-interactor/GameInteractor_State.cpp7
-rw-r--r--soh/src/overlays/actors/ovl_player_actor/z_player.c11
4 files changed, 17 insertions, 8 deletions
diff --git a/soh/soh/Enhancements/game-interactor/GameInteractionEffect.cpp b/soh/soh/Enhancements/game-interactor/GameInteractionEffect.cpp
index b1edfe229..c27b207f0 100644
--- a/soh/soh/Enhancements/game-interactor/GameInteractionEffect.cpp
+++ b/soh/soh/Enhancements/game-interactor/GameInteractionEffect.cpp
@@ -233,7 +233,7 @@ namespace GameInteractionEffect {
GameInteractor::State::LinkSize = (GILinkSize)parameter;
}
void ModifyLinkSize::_Remove() {
- GameInteractor::State::LinkSize = GI_LINK_SIZE_NORMAL;
+ GameInteractor::State::LinkSize = GI_LINK_SIZE_RESET;
}
// MARK: - InvisibleLink
diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h
index fb36793b7..5ebfc24f0 100644
--- a/soh/soh/Enhancements/game-interactor/GameInteractor.h
+++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h
@@ -10,6 +10,7 @@ typedef enum {
/* 0x01 */ GI_LINK_SIZE_GIANT,
/* 0x02 */ GI_LINK_SIZE_MINISH,
/* 0x03 */ GI_LINK_SIZE_PAPER,
+ /* 0x04 */ GI_LINK_SIZE_RESET
} GILinkSize;
typedef enum {
@@ -22,9 +23,9 @@ typedef enum {
extern "C" {
#endif
uint8_t GameInteractor_NoUIActive();
-GILinkSize GameInteractor_LinkSize();
+GILinkSize GameInteractor_GetLinkSize();
+void GameInteractor_SetLinkSize(GILinkSize size);
uint8_t GameInteractor_InvisibleLinkActive();
-uint8_t GameInteractor_ResetLinkScale();
uint8_t GameInteractor_OneHitKOActive();
uint8_t GameInteractor_PacifistModeActive();
uint8_t GameInteractor_DisableZTargetingActive();
diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_State.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_State.cpp
index 4846080b0..23222bb4b 100644
--- a/soh/soh/Enhancements/game-interactor/GameInteractor_State.cpp
+++ b/soh/soh/Enhancements/game-interactor/GameInteractor_State.cpp
@@ -27,10 +27,15 @@ uint8_t GameInteractor_NoUIActive() {
}
// MARK: - GameInteractor::State::LinkSize
-GILinkSize GameInteractor_LinkSize() {
+GILinkSize GameInteractor_GetLinkSize() {
return GameInteractor::State::LinkSize;
}
+// MARK: - GameInteractor::State::LinkSize
+void GameInteractor_SetLinkSize(GILinkSize size) {
+ GameInteractor::State::LinkSize = size;
+}
+
// MARK: - GameInteractor::State::InvisibleLinkActive
uint8_t GameInteractor_InvisibleLinkActive() {
return GameInteractor::State::InvisibleLinkActive;
diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c
index dca3c6a19..a14f05c55 100644
--- a/soh/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c
@@ -10995,7 +10995,13 @@ void Player_Update(Actor* thisx, PlayState* play) {
MREG(54) = this->actor.world.pos.z;
MREG(55) = this->actor.world.rot.y;
- switch (GameInteractor_LinkSize()) {
+ switch (GameInteractor_GetLinkSize()) {
+ case GI_LINK_SIZE_RESET:
+ this->actor.scale.x = 0.01f;
+ this->actor.scale.y = 0.01f;
+ this->actor.scale.z = 0.01f;
+ GameInteractor_SetLinkSize(GI_LINK_SIZE_NORMAL);
+ break;
case GI_LINK_SIZE_GIANT:
this->actor.scale.x = 0.02f;
this->actor.scale.y = 0.02f;
@@ -11013,9 +11019,6 @@ void Player_Update(Actor* thisx, PlayState* play) {
break;
case GI_LINK_SIZE_NORMAL:
default:
- this->actor.scale.x = 0.01f;
- this->actor.scale.y = 0.01f;
- this->actor.scale.z = 0.01f;
break;
}