CAIProc_StateSwitchSendMessage

This commit is contained in:
krystalgamer 2024-06-04 18:12:47 +02:00
parent b969a18fa1
commit 3d18adf6f2
6 changed files with 50 additions and 7 deletions

17
ai.cpp
View File

@ -97,6 +97,15 @@ CAIProc_Fall::CAIProc_Fall(CBaddy *pBaddy, int a3)
this->AttachProc(PROC_FALL_TYPE, pBaddy, a3);
}
// @Ok
CAIProc_StateSwitchSendMessage::CAIProc_StateSwitchSendMessage(CBaddy *pBaddy, int a3)
{
this->AttachProc(STATE_SWITCH_SEND_MESSAGE, pBaddy, 0);
this->mFlags = pBaddy->field_31C;
this->field_24 = a3;
}
void validate_CAIProc(void)
{
VALIDATE(CAIProc, pBaddy, 0x4);
@ -135,3 +144,11 @@ void validate_CAIProc_Fall(void)
{
VALIDATE_SIZE(CAIProc_Fall, 0x20);
}
void validate_CAIProc_StateSwitchSendMessage(void)
{
VALIDATE_SIZE(CAIProc_StateSwitchSendMessage, 0x28);
VALIDATE(CAIProc_StateSwitchSendMessage, mFlags, 0x20);
VALIDATE(CAIProc_StateSwitchSendMessage, field_24, 0x24);
}

12
ai.h
View File

@ -8,6 +8,7 @@
#include "vector.h"
#include "baddy.h"
#include "mem.h"
#include "stateflags.h"
enum AIProcType
{
@ -17,6 +18,8 @@ enum AIProcType
UNK_260 = 260,
PROC_FALL_TYPE = 770,
STATE_SWITCH_SEND_MESSAGE = 0x60601,
};
class CAIProc : public CClass
@ -63,10 +66,19 @@ class CAIProc_Fall : public CAIProc
EXPORT CAIProc_Fall(CBaddy *, int);
};
class CAIProc_StateSwitchSendMessage : public CAIProc
{
public:
EXPORT CAIProc_StateSwitchSendMessage(CBaddy *, int);
SStateFlags mFlags;
int field_24;
};
void validate_CAIProc(void);
void validate_CAIProc_LookAt(void);
void validate_CAIProc_RotY(void);
void validate_CAIProc_Fall(void);
void validate_CAIProc_StateSwitchSendMessage(void);
#endif

View File

@ -5,13 +5,7 @@
#include "export.h"
#include "ob.h"
struct SStateFlags{
union {
__int16 flags[2];
int bothFlags;
};
};
#include "stateflags.h"
class CBaddy : public CSuper {

View File

@ -303,6 +303,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
validate_CRhinoNasalSteam();
validate_CAIProc_RotY();
validate_CAIProc_Fall();
validate_CAIProc_StateSwitchSendMessage();
puts("[*] Validation done!");

View File

@ -1036,6 +1036,10 @@ SOURCE=.\spool.h
# End Source File
# Begin Source File
SOURCE=.\stateflags.h
# End Source File
# Begin Source File
SOURCE=.\submarin.h
# End Source File
# Begin Source File

15
stateflags.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
#ifndef STATEFLAGS_H
#define STATEFLAGS_H
struct SStateFlags{
union {
__int16 flags[2];
int bothFlags;
};
};
#endif