summaryrefslogtreecommitdiff
path: root/src/enemy
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-07-25 19:38:22 +0300
committerTal Hayon <talhayon1@gmail.com>2022-07-27 07:34:59 +0300
commitc0014dbcf62a7d0ffd282e8747bc2ab495378443 (patch)
tree424eaeed4dfc45296864596281cc5509693834f1 /src/enemy
parent28aa81248455d1d4238b99b217abbfd9e510214c (diff)
Match sub_0802D33C
Diffstat (limited to 'src/enemy')
-rw-r--r--src/enemy/gleerok.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c
index 1cc2aaa0..7f34d511 100644
--- a/src/enemy/gleerok.c
+++ b/src/enemy/gleerok.c
@@ -223,28 +223,21 @@ void sub_0802D258(GleerokEntity* this) {
sub_0802E768(this->unk_84);
}
-NONMATCH("asm/non_matching/gleerok/sub_0802D33C.inc", void sub_0802D33C(GleerokEntity* this)) {
- u8* unk_84 = (u8*)this->unk_84;
- u8* ptr = unk_84;
- u8* ptr2;
- u32 i = 0;
- ptr += 0x3c;
- ptr2 = ptr;
-
- do {
- DeleteEntity(*(Entity**)ptr);
- ptr += 4;
- } while (i < 4);
-
- ptr2 += (i << 2);
- *(u32*)((*(u8**)ptr2) + 0x45) = 0;
- *((*(u8**)ptr2) + 0x6d) |= 1;
- ((Entity*)(*(u8**)(unk_84 + 0x50)))->health = 0;
- ((Entity*)(*(u8**)(unk_84 + 0x50)))->type2 = 0;
- ((Entity*)(*(u8**)(unk_84 + 0x50)))->spriteSettings.draw &= ~1;
+void sub_0802D33C(GleerokEntity* this) {
+ Gleerok_HeapStruct* unk_84 = this->unk_84;
+ u32 i;
+
+ for (i = 0; i < 4; i++) {
+ DeleteEntity(unk_84->entities[i]);
+ }
+
+ unk_84->entities[i]->health = 0;
+ ((GenericEntity*)unk_84->entities[i])->field_0x6c.HALF.HI |= 1;
+ unk_84->ent2->health = 0;
+ unk_84->ent2->type2 = 0;
+ unk_84->ent2->spriteSettings.draw &= ~1;
DeleteThisEntity();
}
-END_NONMATCH
void Gleerok_OnTick(GleerokEntity* this) {
gUnk_080CD7B8[super->action](this);