CSuperDocOck::GetNewCommandBlock

This commit is contained in:
krystalgamer 2024-09-02 23:07:08 +01:00
parent c98c33058f
commit cf8230ee3e
2 changed files with 29 additions and 1 deletions

View File

@ -12,6 +12,33 @@
extern CBaddy* BaddyList;
extern CPlayer* MechList;
// @Ok
INLINE i32* CSuperDocOck::GetNewCommandBlock(u32 a1)
{
i32* res = static_cast<i32*>(DCMem_New(4 * a1, 0, 1, 0, 1));
res[a1 - 1] = 0;
if (!this->field_348)
{
this->field_348 = res;
}
else
{
i32* it = this->field_348;
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;
}
// @Ok
i32 CSuperDocOck::Hit(SHitInfo* a2)
{

View File

@ -16,7 +16,8 @@ public:
EXPORT void DoPhysics(void);
EXPORT void RenderClaws(void);
EXPORT void KillAllCommandBlocks(void);
EXPORT int* KillCommandBlock(int*);
EXPORT i32* KillCommandBlock(i32*);
EXPORT i32* GetNewCommandBlock(u32);
EXPORT void PlaySingleAnim(u32, i32, i32);
EXPORT void Initialise(void);