CThug::HelpOutBuddy

This commit is contained in:
krystalgamer 2024-06-09 18:59:18 +02:00
parent db7c4fa868
commit 2a0b4f6516
8 changed files with 40 additions and 6 deletions

View File

@ -833,7 +833,7 @@ void validate_CBaddy(void){
VALIDATE(CBaddy, field_288, 0x288);
VALIDATE(CBaddy, field_28C, 0x28C);
VALIDATE(CBaddy, field_290, 0x290);
VALIDATE(CBaddy, pMessage, 0x290);
VALIDATE(CBaddy, field_294, 0x294);
VALIDATE(CBaddy, field_298, 0x298);

View File

@ -13,6 +13,7 @@ union IntToBytes
u8 Bytes[4];
};
class CMessage;
class CBaddy : public CSuper {
public:
@ -115,7 +116,7 @@ public:
int field_288;
unsigned int *field_28C;
int field_290;
CMessage* pMessage;
IntToBytes field_294;
IntToBytes field_298;

View File

@ -13,7 +13,7 @@ void CLizard::AI(void)
this->CycleAnim(this->field_12A == 0 ? 5 : 0, 1);
}
if (this->field_290)
if (this->pMessage)
{
this->CleanUpMessages(1, 0);
}

View File

@ -6,4 +6,7 @@
void validate_CMessage(void)
{
VALIDATE_SIZE(CMessage, 0x44);
VALIDATE(CMessage, mNext, 0x8);
VALIDATE(CMessage, mHandle, 0x18);
}

View File

@ -4,21 +4,31 @@
#ifndef MESSAGE_H
#define MESSAGE_H
#include "baddy.h"
#include "main.h"
#include "mem.h"
class CBaddy;
struct SMessageData
{};
class CMessage : public CClass
{
public:
unsigned char pad[0x40];
unsigned char pad[0x4];
CMessage* mNext;
u8 padAfter8[0x18-0x8-4];
SHandle mHandle;
u8 padAfter18[0x44-0x18-8];
EXPORT CMessage(CBaddy*, CBaddy*, int a4, SMessageData*)
{
*pad = a4;
}
};
void validate_CMessage(void);

2
mj.cpp
View File

@ -6,7 +6,7 @@
// @Ok
void CMJ::AI(void)
{
if (this->field_290){
if (this->pMessage){
this->CleanUpMessages(1, 0);
}

View File

@ -2,6 +2,7 @@
#include "validate.h"
#include "trig.h"
#include "m3dutils.h"
#include "message.h"
// @NotOk
// Globals
@ -139,6 +140,22 @@ void CThug::SetThugType(int type)
}
// @TODO
void CThug::RunToWhereTheActionIs(CVector*)
{}
// @Ok
void CThug::HelpOutBuddy(CMessage *pMessage)
{
if (this->field_31C.bothFlags == 2 || this->field_31C.bothFlags == 1)
{
CItem *pItem = reinterpret_cast<CItem*>(Mem_RecoverPointer(&pMessage->mHandle));
if (pItem)
this->RunToWhereTheActionIs(&pItem->mPos);
}
}
void validate_CThug(void){
VALIDATE_SIZE(CThug, 0x3C0);

3
thug.h
View File

@ -12,6 +12,9 @@ class CThug : public CBaddy {
public:
EXPORT CThug(int*, int);
EXPORT void ClearAttackFlags(void);
EXPORT void HelpOutBuddy(CMessage*);
EXPORT void RunToWhereTheActionIs(CVector*);
EXPORT virtual void SetThugType(int);
u8 padTop[0x370-0x324];