CVenom::GetNewCommandBlock

This commit is contained in:
krystalgamer 2024-09-02 23:05:56 +01:00
parent 1838532b73
commit c98c33058f
2 changed files with 30 additions and 0 deletions

View File

@ -11,6 +11,33 @@
extern u8 gObjFileRegion; extern u8 gObjFileRegion;
extern CBody* EnvironmentalObjectList; extern CBody* EnvironmentalObjectList;
// @Ok
INLINE i32* CVenom::GetNewCommandBlock(u32 a1)
{
i32* res = static_cast<i32*>(DCMem_New(4 * a1, 0, 1, 0, 1));
res[a1 - 1] = 0;
if (!this->field_35C)
{
this->field_35C = res;
}
else
{
i32* it = this->field_35C;
while (1)
{
if (!it[it[1] - 1])
break;
it = reinterpret_cast<i32*>(it[it[1] - 1]);
}
it[it[1] - 1] = reinterpret_cast<i32>(res);
}
return res;
}
// @MEDIUMTODO // @MEDIUMTODO
CVenom::CVenom(int*, int) CVenom::CVenom(int*, int)
{ {

View File

@ -14,8 +14,11 @@ public:
EXPORT CVenom(i32*, i32); EXPORT CVenom(i32*, i32);
EXPORT void Shouldnt_DoPhysics_Be_Virtual(void); EXPORT void Shouldnt_DoPhysics_Be_Virtual(void);
EXPORT void DoPhysics(void); EXPORT void DoPhysics(void);
EXPORT i32* KillCommandBlock(i32*); EXPORT i32* KillCommandBlock(i32*);
EXPORT void KillAllCommandBlocks(void); EXPORT void KillAllCommandBlocks(void);
EXPORT i32* GetNewCommandBlock(u32);
EXPORT u8 TugImpulse(CVector *, CVector *, CVector *); EXPORT u8 TugImpulse(CVector *, CVector *, CVector *);
EXPORT void PlayNextFootstepSFX(void); EXPORT void PlayNextFootstepSFX(void);
EXPORT void GetTargetPosFromNode(CVector *, i32); EXPORT void GetTargetPosFromNode(CVector *, i32);