mirror of https://github.com/zeldaret/tmc.git
Update EntityData struct
This commit is contained in:
parent
d9f7ad89ad
commit
72dbd29bb9
|
@ -63,13 +63,13 @@ typedef struct {
|
||||||
|
|
||||||
// Packets used to store which entities to load in a room
|
// Packets used to store which entities to load in a room
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 type : 4;
|
u8 kind : 4;
|
||||||
u8 layer : 4;
|
u8 layer : 4;
|
||||||
u8 flags : 4;
|
u8 flags : 4;
|
||||||
u8 unk : 4;
|
u8 unk : 4;
|
||||||
u8 subtype;
|
u8 id;
|
||||||
u8 form;
|
u8 type;
|
||||||
u32 parameter;
|
u32 type2;
|
||||||
u16 xPos;
|
u16 xPos;
|
||||||
u16 yPos;
|
u16 yPos;
|
||||||
u32 spritePtr;
|
u32 spritePtr;
|
||||||
|
|
|
@ -34,7 +34,7 @@ void sub_0804B058(EntityData* dat) {
|
||||||
if ((dat != NULL) && *(u8*)dat != 0xff) {
|
if ((dat != NULL) && *(u8*)dat != 0xff) {
|
||||||
uVar2 = 0;
|
uVar2 = 0;
|
||||||
do {
|
do {
|
||||||
if ((uVar2 < 0x20) && ((dat->type) == 3)) {
|
if ((uVar2 < 0x20) && ((dat->kind) == 3)) {
|
||||||
if (sub_08049D1C(uVar2) != 0) {
|
if (sub_08049D1C(uVar2) != 0) {
|
||||||
ent = LoadRoomEntity(dat);
|
ent = LoadRoomEntity(dat);
|
||||||
if ((ent != NULL) && (ent->kind == 3)) {
|
if ((ent != NULL) && (ent->kind == 3)) {
|
||||||
|
|
|
@ -86,10 +86,10 @@ u32 Manager28_FindMatchingEntities(Manager28* this) {
|
||||||
EntityData* tmp = GetCurrentRoomProperty(this->manager.unk_0b);
|
EntityData* tmp = GetCurrentRoomProperty(this->manager.unk_0b);
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
return 0;
|
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;
|
Entity* tmp2;
|
||||||
u32 i;
|
u32 i;
|
||||||
if (tmp->type != 3)
|
if (tmp->kind != 3)
|
||||||
continue;
|
continue;
|
||||||
tmp2 = Manager28_FindMatchingEntity(tmp);
|
tmp2 = Manager28_FindMatchingEntity(tmp);
|
||||||
if (!tmp2)
|
if (!tmp2)
|
||||||
|
@ -115,7 +115,7 @@ Entity* Manager28_FindMatchingEntity(EntityData* unk1) {
|
||||||
y = unk1->yPos + gRoomControls.roomOriginY;
|
y = unk1->yPos + gRoomControls.roomOriginY;
|
||||||
tmp = &gUnk_03003D90;
|
tmp = &gUnk_03003D90;
|
||||||
for (i = tmp->first; (u32)i != (u32)tmp; i = i->next) {
|
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;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue