From 537001db4814ed5fdc3630adc5fa10b93450b82b Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Tue, 31 Oct 2023 22:58:45 -0400 Subject: [PATCH] Fakematch a func in d_a_player_npc --- include/d/actor/d_a_player_npc.h | 12 ++++++------ src/d/actor/d_a_player_npc.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/d/actor/d_a_player_npc.h b/include/d/actor/d_a_player_npc.h index eb7c35d4e..5f3a50e97 100644 --- a/include/d/actor/d_a_player_npc.h +++ b/include/d/actor/d_a_player_npc.h @@ -12,12 +12,12 @@ public: /* 0x4E9 */ u8 mDamageFogTimer; /* 0x4EA */ u8 field_4EA[0x4EC - 0x4EA]; - void returnLink() { m4E4 |= 1; } - void offReturnLink() { m4E4 &= ~1; } - bool isReturnLink() { return m4E4 & 1; } - void onEventAccept() { m4E4 |= 2; } - void offEventAccept() { m4E4 &= ~2; } - bool isEventAccept() { return m4E4 & 2; } + void returnLink() { cLib_onBit(m4E4, 0x01UL); } + void offReturnLink() { cLib_offBit(m4E4, 0x01UL); } + bool isReturnLink() { return cLib_checkBit(m4E4, 0x01UL); } + void onEventAccept() { cLib_onBit(m4E4, 0x02UL); } + void offEventAccept() { cLib_offBit(m4E4, 0x02UL); } + bool isEventAccept() { return cLib_checkBit(m4E4, 0x02UL); } u8 getDamageFogTimer() { return mDamageFogTimer; } void setDamageFogTimer(u8 timer) { mDamageFogTimer = timer; } diff --git a/src/d/actor/d_a_player_npc.cpp b/src/d/actor/d_a_player_npc.cpp index 9fac0da0d..a89a50197 100644 --- a/src/d/actor/d_a_player_npc.cpp +++ b/src/d/actor/d_a_player_npc.cpp @@ -50,6 +50,7 @@ BOOL daPy_npc_c::check_moveStop() { /* 8015A524-8015A590 .text setRestart__10daPy_npc_cFSc */ void daPy_npc_c::setRestart(s8 option) { + /* Nonmatching (this matched at some point, what broke it?) */ if (option == dComIfGs_getRestartOption()) { bool playerInDoor = dComIfGp_getPlayer(0)->mEvtInfo.checkCommandDoor(); s8 roomNo = current.roomNo; @@ -152,8 +153,9 @@ BOOL daPy_npc_c::initialRestartOption(s8 option, int save) { /* 8015ABD8-8015AC74 .text checkNowPosMove__10daPy_npc_cFPCc */ BOOL daPy_npc_c::checkNowPosMove(const char* pName) { - /* Nonmatching (regalloc) */ - if (!dComIfGp_event_runCheck()) { + // Using the dComIfGp_event_runCheck inline makes the codegen not match. + // if (!dComIfGp_event_runCheck()) { + if (!g_dComIfG_gameInfo.play.getEvent().runCheck()) { return TRUE; } if (mEvtInfo.checkCommandTalk()) {