From 72dbd29bb9548462898de22ae437a0981c044d77 Mon Sep 17 00:00:00 2001 From: theo3 Date: Sun, 28 Feb 2021 23:11:11 -0800 Subject: [PATCH] Update EntityData struct --- include/room.h | 8 ++++---- src/loadRoom.c | 2 +- src/manager/manager28.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/room.h b/include/room.h index 35ed3137..f192c164 100644 --- a/include/room.h +++ b/include/room.h @@ -63,13 +63,13 @@ typedef struct { // Packets used to store which entities to load in a room typedef struct { - u8 type : 4; + u8 kind : 4; u8 layer : 4; u8 flags : 4; u8 unk : 4; - u8 subtype; - u8 form; - u32 parameter; + u8 id; + u8 type; + u32 type2; u16 xPos; u16 yPos; u32 spritePtr; diff --git a/src/loadRoom.c b/src/loadRoom.c index 04b8e02c..459b3ad5 100644 --- a/src/loadRoom.c +++ b/src/loadRoom.c @@ -34,7 +34,7 @@ void sub_0804B058(EntityData* dat) { if ((dat != NULL) && *(u8*)dat != 0xff) { uVar2 = 0; do { - if ((uVar2 < 0x20) && ((dat->type) == 3)) { + if ((uVar2 < 0x20) && ((dat->kind) == 3)) { if (sub_08049D1C(uVar2) != 0) { ent = LoadRoomEntity(dat); if ((ent != NULL) && (ent->kind == 3)) { diff --git a/src/manager/manager28.c b/src/manager/manager28.c index af59e09e..07cac266 100644 --- a/src/manager/manager28.c +++ b/src/manager/manager28.c @@ -86,10 +86,10 @@ u32 Manager28_FindMatchingEntities(Manager28* this) { EntityData* tmp = GetCurrentRoomProperty(this->manager.unk_0b); if (!tmp) return 0; - for (; *((u8*)tmp) != 0xFF && !(tmp->type == 9 && tmp->subtype == 0x28); tmp++) { + for (; *((u8*)tmp) != 0xFF && !(tmp->kind == 9 && tmp->id == 0x28); tmp++) { Entity* tmp2; u32 i; - if (tmp->type != 3) + if (tmp->kind != 3) continue; tmp2 = Manager28_FindMatchingEntity(tmp); if (!tmp2) @@ -115,7 +115,7 @@ Entity* Manager28_FindMatchingEntity(EntityData* unk1) { y = unk1->yPos + gRoomControls.roomOriginY; tmp = &gUnk_03003D90; for (i = tmp->first; (u32)i != (u32)tmp; i = i->next) { - if (x == i->x.HALF.HI && y == i->y.HALF.HI && unk1->subtype == i->id && 3 == i->kind && unk1->form == i->type) { + if (x == i->x.HALF.HI && y == i->y.HALF.HI && unk1->id == i->id && 3 == i->kind && unk1->type == i->type) { return i; } }