From 0a7aa39f41692f6c28a24136e0f786363e746871 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Sun, 16 Oct 2022 18:16:28 +0300 Subject: [PATCH] Match and link CScriptPlayerStateChange. Thanks Antidote --- configure.py | 2 +- include/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.hpp | 2 ++ obj_files.mk | 2 +- src/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.cpp | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.py b/configure.py index 91327f2e..1acf269c 100755 --- a/configure.py +++ b/configure.py @@ -292,7 +292,7 @@ LIBS = [ ["MetroidPrime/BodyState/CABSIdle", True], "MetroidPrime/BodyState/CABSFlinch", "MetroidPrime/BodyState/CABSAim", - "MetroidPrime/ScriptObjects/CScriptPlayerStateChange", + ["MetroidPrime/ScriptObjects/CScriptPlayerStateChange", True], "MetroidPrime/Enemies/CThardus", "MetroidPrime/CActorParticles", "MetroidPrime/Enemies/CWallCrawlerSwarm", diff --git a/include/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.hpp b/include/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.hpp index 1a0cc0b6..f1393ee2 100644 --- a/include/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.hpp +++ b/include/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.hpp @@ -21,6 +21,8 @@ public: void Accept(IVisitor& visit) override; void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override; ~CScriptPlayerStateChange(); + + bool Filtered() { return x44_ctrlCmdOpt == kCCO_Filtered; } }; #endif // _CSCRIPTPLAYERSTATECHANGE diff --git a/obj_files.mk b/obj_files.mk index ebb5a04d..08d5c560 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -259,7 +259,7 @@ METROIDPRIME :=\ $(BUILD_DIR)/src/MetroidPrime/BodyState/CABSIdle.o\ $(BUILD_DIR)/asm/MetroidPrime/BodyState/CABSFlinch.o\ $(BUILD_DIR)/asm/MetroidPrime/BodyState/CABSAim.o\ - $(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.o\ + $(BUILD_DIR)/src/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.o\ $(BUILD_DIR)/asm/MetroidPrime/Enemies/CThardus.o\ $(BUILD_DIR)/asm/MetroidPrime/CActorParticles.o\ $(BUILD_DIR)/asm/MetroidPrime/Enemies/CWallCrawlerSwarm.o\ diff --git a/src/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.cpp b/src/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.cpp index fcf5a8f0..553558cb 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptPlayerStateChange.cpp @@ -28,7 +28,7 @@ void CScriptPlayerStateChange::AcceptScriptMsg(EScriptObjectMessage msg, TUnique if (x44_ctrlCmdOpt != kCCO_Unfiltered) { switch (x40_ctrl) { case kC_Filtered: - bool filtered = !(1 - x44_ctrlCmdOpt); + bool filtered = Filtered(); ControlMapper::SetCommandFiltered(ControlMapper::kC_OrbitClose, filtered); ControlMapper::SetCommandFiltered(ControlMapper::kC_OrbitConfirm, filtered); ControlMapper::SetCommandFiltered(ControlMapper::kC_OrbitDown, filtered);