From 2447d5a02a7b2dc1f4caa4a87b1bddb9fd70c2b5 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Tue, 9 Dec 2025 15:41:11 -0500 Subject: [PATCH] d_a_npc_cdn3 OK (#2935) --- configure.py | 2 +- include/d/actor/d_a_npc_cdn3.h | 23 +++++++++++----------- src/d/actor/d_a_npc_cdn3.cpp | 36 ++++++++++++++++++---------------- 3 files changed, 32 insertions(+), 29 deletions(-) diff --git a/configure.py b/configure.py index d8423df2163..324ae1941ee 100755 --- a/configure.py +++ b/configure.py @@ -2021,7 +2021,7 @@ config.libs = [ ActorRel(MatchingFor(ALL_GCN), "d_a_npc_blue_ns"), ActorRel(MatchingFor(ALL_GCN), "d_a_npc_bou"), ActorRel(Equivalent, "d_a_npc_bouS"), # weak func order (sinShort) - ActorRel(Equivalent, "d_a_npc_cdn3"), # weak func order (~csXyz); vtable order + ActorRel(MatchingFor(ALL_GCN), "d_a_npc_cdn3"), ActorRel(MatchingFor(ALL_GCN), "d_a_npc_chat"), ActorRel(MatchingFor(ALL_GCN), "d_a_npc_chin"), ActorRel(MatchingFor(ALL_GCN), "d_a_npc_clerka"), diff --git a/include/d/actor/d_a_npc_cdn3.h b/include/d/actor/d_a_npc_cdn3.h index c1436a8e3d8..d20ddfdce52 100644 --- a/include/d/actor/d_a_npc_cdn3.h +++ b/include/d/actor/d_a_npc_cdn3.h @@ -51,11 +51,11 @@ public: void executeRelief(); void setAngle(); void pathMoveF(); - int ctrlMsgAnm(); + inline int ctrlMsgAnm(); bool searchNextScheduleTagSub(fopAc_ac_c*); bool searchFirstScheduleTagSub(fopAc_ac_c*); void checkSchedule(); - void setSchedule(daTagSchedule_c*); + inline void setSchedule(daTagSchedule_c*); inline bool isInShop(); bool isChairStyle(); bool isNoTurnTalk(); @@ -91,14 +91,14 @@ public: int normtalkb(void*); int sellme(void*); int sing(void*); - int create(); - void create_init(); + inline int create(); + inline void create_init(); inline int createHeap(); - void setMtx(); - void lookat(); - virtual ~daNpcCdn3_c(); - int execute(); - void checkTimeSchedule(); + inline void setMtx(); + inline void lookat(); + inline virtual ~daNpcCdn3_c(); + inline int execute(); + inline void checkTimeSchedule(); inline int draw(); @@ -326,13 +326,14 @@ public: int orderEvent() { #if PLATFORM_SHIELD - if (mFlowNodeNum > 0) { + if (mFlowNodeNum > 0) #else if ((!mIsDarkWorld || daPy_py_c::checkNowWolfEyeUp()) && mFlowNodeNum > 0 && ((attention_info.flags & fopAc_AttnFlag_SPEAK_e) || - (attention_info.flags & fopAc_AttnFlag_TALK_e))) { + (attention_info.flags & fopAc_AttnFlag_TALK_e))) #endif + { eventInfo.onCondition(dEvtCnd_CANTALK_e); } return 1; diff --git a/src/d/actor/d_a_npc_cdn3.cpp b/src/d/actor/d_a_npc_cdn3.cpp index a2c13ef36ea..735926a60b7 100644 --- a/src/d/actor/d_a_npc_cdn3.cpp +++ b/src/d/actor/d_a_npc_cdn3.cpp @@ -909,12 +909,13 @@ void daNpcCdn3_c::checkSchedule() { int schedStartTime = (u16)((rawStartTime / 10) * 60 + (rawStartTime % 10) * 10); int currentTime = getTime(); #if PLATFORM_SHIELD - if (field_0xb88->getWeekNum() == getDayOfWeek() && schedStartTime <= currentTime) { + if (field_0xb88->getWeekNum() == getDayOfWeek() && schedStartTime <= currentTime) #else int currentDay = getDayOfWeek(); int schedDay = field_0xb88->getWeekNum(); - if (schedDay == currentDay && schedStartTime <= currentTime) { + if (schedDay == currentDay && schedStartTime <= currentTime) #endif + { setSchedule(field_0xb88); field_0xb88 = NULL; setAction(MODE_PATH); @@ -1454,10 +1455,6 @@ int daNpcCdn3_c::sing(void* param_0) { return field_0xaa0 == 0; } -static int daNpcCdn3_Create(void* i_this) { - return static_cast(i_this)->create(); -} - int daNpcCdn3_c::create() { fopAcM_ct(this, daNpcCdn3_c); mIsDarkWorld = dKy_darkworld_check(); @@ -1575,11 +1572,6 @@ void daNpcCdn3_c::lookat() { mLookat.action(cStack_80, eyePos, this, afStack_38, NULL != m_targetAct.getActorP()); } -static int daNpcCdn3_Delete(void* i_this) { - static_cast(i_this)->~daNpcCdn3_c(); - return 1; -} - daNpcCdn3_c::~daNpcCdn3_c() { removeResrc(m_type, mObjNum); if (heap != NULL) { @@ -1591,10 +1583,6 @@ daNpcCdn3_c::~daNpcCdn3_c() { #endif } -static int daNpcCdn3_Execute(void* i_this) { - return static_cast(i_this)->execute(); -} - int daNpcCdn3_c::execute() { mAcchCir.SetWallH(Cd2_HIO_chkWallH(m_type)); mAcchCir.SetWallR(Cd2_HIO_chkWallR(m_type)); @@ -1688,12 +1676,13 @@ void daNpcCdn3_c::checkTimeSchedule() { } } else if (field_0xb95 != 0 && mTagSched->getStartEnd() != 1) { #if PLATFORM_SHIELD - if (mTagSched->getWeekNum() == getDayOfWeek() && field_0xb8c <= iVar2) { + if (mTagSched->getWeekNum() == getDayOfWeek() && field_0xb8c <= iVar2) #else int day = getDayOfWeek(); int weekNum = mTagSched->getWeekNum(); - if (weekNum == day && field_0xb8c <= iVar2) { + if (weekNum == day && field_0xb8c <= iVar2) #endif + { field_0xb95 = 0; } } @@ -1721,6 +1710,19 @@ inline int daNpcCdn3_c::draw() { return 1; } +static int daNpcCdn3_Create(void* i_this) { + return static_cast(i_this)->create(); +} + +static int daNpcCdn3_Delete(void* i_this) { + static_cast(i_this)->~daNpcCdn3_c(); + return 1; +} + +static int daNpcCdn3_Execute(void* i_this) { + return static_cast(i_this)->execute(); +} + static int daNpcCdn3_Draw(void* i_this) { return static_cast(i_this)->draw(); }