FindBaddyOfType

This commit is contained in:
krystalgamer 2024-05-25 19:34:11 +02:00
parent 46d2c3a345
commit 90cd6664cf
3 changed files with 32 additions and 1 deletions

View File

@ -758,6 +758,29 @@ void CBaddy::Baddy_SendSignal(void)
Trig_SendSignalToLinks(ptr);
}
static CBaddy* gBaddylist;
// @Ok
CBaddy* FindBaddyOfType(int type)
{
CBaddy *current = gBaddylist;
if (current)
{
while (current)
{
if (current->field_38 == type)
{
return current;
}
current = reinterpret_cast<CBaddy*>(current->field_20);
}
}
return NULL;
}
void validate_CBaddy(void){
VALIDATE_SIZE(CBaddy, 0x324);

View File

@ -1,4 +1,8 @@
#pragma once
#ifndef BADDY_H
#define BADDY_H
#include "export.h"
#include "ob.h"
@ -172,6 +176,10 @@ public:
__int16 field_32E;
};
EXPORT CBaddy* FindBaddyOfType(int);
void validate_CBaddy(void);
void validate_CScriptOnlyBaddy(void);
void validate_SStateFlags(void);
#endif

2
ob.h
View File

@ -33,7 +33,7 @@ public:
int field_30;
CItem *field_34;
__int16 field_38;
unsigned __int16 field_38;
unsigned char padAfter38[2];