CBaddy::StruckGameObject

This commit is contained in:
krystalgamer 2024-05-13 19:34:26 +02:00
parent 79fd6d9ec6
commit 902205b9cb
4 changed files with 40 additions and 1 deletions

View File

@ -154,6 +154,32 @@ int CBaddy::PathCheck(CVector* a2, CVector* a3, CVector* a4, int a5)
}
static CBody** const dword_56E990 = (CBody**)0x56E990;
// @Ok
CBody* CBaddy::StruckGameObject(int a2, int a3)
{
CBody *result;
if ( !a2
|| (result = Utils_CheckObjectCollision(
&this->field_2FC,
&this->mPos,
globalSuper,
this)) == 0 )
{
if (a3 && (result = Utils_CheckObjectCollision(&this->field_2FC, &this->mPos, *dword_56E990, this)))
{
print_if_false(result != this, "smoething's wrong in the state of denmark");
return result;
}
return NULL;
}
return result;
}
void validate_CBaddy(void){
VALIDATE_SIZE(CBaddy, 0x324);

View File

@ -1,5 +1,4 @@
#pragma once
#include "export.h"
#include "ob.h"
@ -23,6 +22,7 @@ public:
EXPORT int RunTimer(int*);
EXPORT int PathCheckGuts(CVector*, CVector*, CVector*, int);
EXPORT int PathCheck(CVector*, CVector*, CVector*, int);
EXPORT CBody* StruckGameObject(int, int);
unsigned char padBaddyStart[0x14];

View File

@ -144,3 +144,9 @@ int Rnd(int)
{
return 0x420420;
}
// @TODO
CBody* Utils_CheckObjectCollision(CVector*, CVector*, CBody*, CBody*)
{
return reinterpret_cast<CBody*>(0x13052024);
}

View File

@ -1,7 +1,11 @@
#pragma once
#ifndef UTILS_H
#define UTILS_H
#include "export.h"
#include "vector.h"
#include "ob.h"
EXPORT int Utils_CrapDist(const CVector& a,const CVector& b);
@ -10,3 +14,6 @@ EXPORT int Utils_CompareStrings(const char* left, const char* right);
EXPORT int Utils_ArcCos(int val);
EXPORT int Utils_CopyString(const char*, char*, int);
EXPORT int Rnd(int);
EXPORT CBody* Utils_CheckObjectCollision(CVector*, CVector*, CBody*, CBody*);
#endif