From 0eff5e040f68c5270965f496265335ef8bdd7136 Mon Sep 17 00:00:00 2001 From: krystalgamer Date: Mon, 29 Jul 2024 18:41:07 +0200 Subject: [PATCH] CCarnage::~CCarnage --- carnage.cpp | 20 ++++++++++++++++++++ carnage.h | 24 ++++++++++++++++-------- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/carnage.cpp b/carnage.cpp index 86de9f4..58ecd99 100644 --- a/carnage.cpp +++ b/carnage.cpp @@ -5,8 +5,22 @@ #include "spool.h" extern const char *gObjFile; +extern CBaddy *BaddyList; EXPORT u8 gObjFileRegion; +// @Ok +CCarnage::~CCarnage(void) +{ + this->DeleteFrom(reinterpret_cast(&BaddyList)); + Panel_DestroyHealthbar(); + + if (this->field_32C) + delete reinterpret_cast(this->field_32C); + + if (this->field_344) + Mem_Delete(this->field_344); +} + // @NotOk // globals CCarnage::CCarnage(int* a2, int a3) @@ -110,9 +124,15 @@ void CCarnage::DoPhysics(void) void validate_CCarnage(void){ VALIDATE_SIZE(CCarnage, 0x37C); + VALIDATE(CCarnage, field_32C, 0x32C); + VALIDATE(CCarnage, field_334, 0x334); VALIDATE(CCarnage, field_338, 0x338); + VALIDATE(CCarnage, field_33C, 0x33C); + + VALIDATE(CCarnage, field_344, 0x344); + VALIDATE(CCarnage, field_354, 0x354); VALIDATE(CCarnage, field_358, 0x358); VALIDATE(CCarnage, field_35C, 0x35C); diff --git a/carnage.h b/carnage.h index ef8dae9..1698bd2 100644 --- a/carnage.h +++ b/carnage.h @@ -9,19 +9,27 @@ class CCarnage : public CBaddy { public: EXPORT CCarnage(int*, int); + EXPORT ~CCarnage(void); + EXPORT void Shouldnt_DoPhysics_Be_Virtual(void); EXPORT void DoPhysics(void); - unsigned char carnageStartPad[0x10]; + u8 carnageStartPad[0x8]; - int field_334; - int field_338; - int field_33C; - unsigned char padAfter33c[0x18 - 4]; + void* field_32C; + u8 padAfter32C[0x334-0x32C-4]; - int field_354; - int field_358; - int field_35C; + i32 field_334; + i32 field_338; + i32 field_33C; + u8 padAfter33c[0x344-0x33C-4]; + + void* field_344; + u8 padAfter344[0x354-0x344-4]; + + i32 field_354; + i32 field_358; + i32 field_35C; unsigned char padAfter35C[0x10-4]; int field_36C;