Skip to content

Commit 3a7b91a

Browse files
LivewireCBmattbruv
andauthored
znpcmessenger (bfbbdecomp#512)
* ship it, YOLO * test * BossSB2 functions and mem offsets * wip push * push fix * couple of bossplankton functions. * znpcmessenger function fix --------- Co-authored-by: Matt P <mattp3259@gmail.com>
1 parent 85f1456 commit 3a7b91a

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

src/SB/Game/zNPCMessenger.cpp

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#include "zNPCMessenger.h"
22

3+
#include "xordarray.h"
34
#include <types.h>
45

56
static NPCPSData g_postoffice;
67

7-
void zNPCCommon::Stun(F32)
8+
NPCPSData* NPCPS_postOffice()
89
{
10+
return &g_postoffice;
911
}
1012

11-
void zNPCMSg_Startup()
13+
void zNPCCommon::Stun(F32)
1214
{
1315
}
1416

@@ -43,6 +45,13 @@ void NPCPS_copyMsgInfo(NPCMsg*, NPCMsg*, float)
4345

4446
void NPCPS_queMessage(NPCMsg*)
4547
{
48+
// LW - 50% match
49+
// probably a simple fix
50+
NPCPSData* tempQue;
51+
52+
tempQue = NPCPS_postOffice();
53+
54+
XOrdAppend(((st_XORDEREDARRAY*)tempQue + 0x2), NULL);
4655
}
4756

4857
S32 NPCPS_flagForMID(en_NPC_MSG_ID)
@@ -68,25 +77,30 @@ void NPCPS_CltPoolReset(NPCPSData*)
6877
{
6978
}
7079

71-
NPCPSData* NPCPS_postOffice()
80+
void NPCPS_grabMsg()
7281
{
73-
return &g_postoffice;
7482
}
7583

76-
void NPCPS_grabMsg()
84+
void NPCPS_freeMsg(NPCMsg*)
7785
{
7886
}
7987

80-
void NPCPS_freeMsg(NPCMsg*)
88+
void zNPCMsg_Startup()
8189
{
90+
NPCPSData* tempStartup;
91+
92+
tempStartup = NPCPS_postOffice();
93+
NPCPS_CltPoolInit(tempStartup, 0x20);
94+
NPCPS_MsgPoolInit(tempStartup, 0x40);
8295
}
8396

8497
void zNPCMsg_SceneReset()
8598
{
86-
// 57% there but not quite
87-
NPCPS_CltPoolReset(NPCPS_postOffice());
88-
NPCPS_MsgPoolReset(NPCPS_postOffice());
89-
return;
99+
NPCPSData* tempReset;
100+
101+
tempReset = NPCPS_postOffice();
102+
NPCPS_CltPoolReset(tempReset);
103+
NPCPS_MsgPoolReset(tempReset);
90104
}
91105

92106
void zNPCMsg_Timestep(xScene*, float)

0 commit comments

Comments
 (0)