diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 2d083c01c..8d3c9f9fa 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -5375,7 +5375,7 @@ void func0f022084(struct chrdata *chr, s16 *room) void func0f0220ac(struct chrdata *chr) { func0f065c44(chr->prop); - func0f022084(chr, &chr->prop->room); + func0f022084(chr, &chr->prop->rooms[0]); func0f065cb0(chr->prop); } @@ -32588,7 +32588,7 @@ bool chrGoToTarget(struct chrdata *chr, u32 speed) (chr->flags & CHRFLAG0_CAN_RUN_FOR_ALARM)) { struct prop *prop = chrGetTargetProp(chr); - if (func0f03843c(chr, &prop->pos, &prop->room, speed)) { + if (func0f03843c(chr, &prop->pos, &prop->rooms[0], speed)) { return true; } } @@ -32605,7 +32605,7 @@ bool chrGoToChr(struct chrdata *chr, u32 dst_chrnum, u32 speed) (chr->flags & CHRFLAG0_CAN_RUN_FOR_ALARM)) { struct chrdata *dstchr = chrFindById(chr, dst_chrnum); - if (dstchr && dstchr->prop && func0f03843c(chr, &dstchr->prop->pos, &dstchr->prop->room, speed)) { + if (dstchr && dstchr->prop && func0f03843c(chr, &dstchr->prop->pos, &dstchr->prop->rooms[0], speed)) { return true; } } @@ -32617,7 +32617,7 @@ bool chrGoToChr(struct chrdata *chr, u32 dst_chrnum, u32 speed) bool func0f03ab74(struct chrdata *chr, struct prop *prop, s32 arg2) { if (func0f039a18(chr) && prop) { - if (func0f03843c(chr, &prop->pos, &prop->room, arg2)) { + if (func0f03843c(chr, &prop->pos, &prop->rooms[0], arg2)) { return true; } } @@ -37874,7 +37874,7 @@ void chrSetFiring(struct chrdata *chr, s32 hand, bool firing) chr->prop->unk3f_02 = firing ? 1 : 0; if (prop) { - func0f08bb5c(prop, firing, chr->prop->room); + func0f08bb5c(prop, firing, chr->prop->rooms[0]); } } @@ -49931,7 +49931,7 @@ bool func0f04a76c(struct chrdata *chr, f32 distance) bool func0f04a79c(u8 chrnum, struct chrdata *chr, f32 distance) { - return func0f04a848(chrnum, chr, distance, &chr->prop->pos, &chr->prop->room); + return func0f04a848(chrnum, chr, distance, &chr->prop->pos, &chr->prop->rooms[0]); } GLOBAL_ASM( @@ -50821,7 +50821,7 @@ bool chrSpawnAtChr(struct chrdata *basechr, s32 body, s32 head, u32 chrnum, u8 * fvalue = func0f03e45c(chr); } - return chrSpawnAtCoord(body, head, &chr->prop->pos, &chr->prop->room, fvalue, ailist, flags); + return chrSpawnAtCoord(body, head, &chr->prop->pos, &chr->prop->rooms[0], fvalue, ailist, flags); } GLOBAL_ASM( @@ -52906,6 +52906,6 @@ void chrEmitSparks(struct chrdata *chr) { if (chr && chr->prop) { func0f0939f8(0, chr->prop, 100, -1, -1, 0, 0, 0, 0, -1, 0, -1, -1, -1, -1); - func0f12f9f0(chr->prop->room, chr->prop, &chr->prop->pos, 0, 0, 1); + func0f12f9f0(chr->prop->rooms[0], chr->prop, &chr->prop->pos, 0, 0, 1); } } diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index b287e23f4..5d8b21f89 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -1676,7 +1676,7 @@ bool aiIfSeesPlayer(void) */ bool ai017a(void) { - if ((g_Vars.chrdata && g_Vars.chrdata->prop && func0f0391ec(g_Vars.chrdata, &g_Vars.chrdata->prop->pos, &g_Vars.chrdata->prop->room, 1)) + if ((g_Vars.chrdata && g_Vars.chrdata->prop && func0f0391ec(g_Vars.chrdata, &g_Vars.chrdata->prop->pos, &g_Vars.chrdata->prop->rooms[0], 1)) || (g_Vars.hovdata && func0f07ae18(g_Vars.hovdata, 0x40) && func0f07af34(g_Vars.hovdata))) { u8 *cmd = g_Vars.ailist + g_Vars.aioffset; g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[2]); @@ -1776,7 +1776,7 @@ bool ai0045(void) u8 *cmd = g_Vars.ailist + g_Vars.aioffset; struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]); - if (chr && chr->prop && func0f0393b4(g_Vars.chrdata, &chr->prop->pos, &chr->prop->room)) { + if (chr && chr->prop && func0f0393b4(g_Vars.chrdata, &chr->prop->pos, &chr->prop->rooms[0])) { g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[3]); } else { g_Vars.aioffset += 4; @@ -2676,8 +2676,8 @@ bool aiIfChrInRoom(void) u16 pad_id = cmd[5] | (cmd[4] << 8); s32 room = chrGetPadRoom(g_Vars.chrdata, pad_id); - if ((cmd[3] == 0 && room >= 0 && chr && chr->prop && chr->prop->room == room) || - (cmd[3] == 1 && chr && chr->prop && chr->prop->room == g_Vars.chrdata->roomtosearch)) { + if ((cmd[3] == 0 && room >= 0 && chr && chr->prop && chr->prop->rooms[0] == room) || + (cmd[3] == 1 && chr && chr->prop && chr->prop->rooms[0] == g_Vars.chrdata->roomtosearch)) { g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[6]); return false; } @@ -2767,7 +2767,7 @@ glabel aiIfTargetInRoom // s32 room_id = cmd[3] | (cmd[2] << 8); // room_id = chrGetPadRoom(g_Vars.chrdata, room_id & 0xffff); // -// if (room_id >= 0 && prop && room_id == prop->room) { +// if (room_id >= 0 && prop && room_id == prop->rooms[0]) { // g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[4]); // } else { // g_Vars.aioffset += 5; @@ -3161,7 +3161,7 @@ bool aiDestroyObject(void) if (entity->obj == 0xeb) { obj->flags = (obj->flags & 0xfffeffff) | 0x20000; - func0f129900(entity->prop, &entity->prop->pos, &entity->prop->room, 3, 0); + func0f129900(entity->prop, &entity->prop->pos, &entity->prop->rooms[0], 3, 0); func0f12e714(entity->prop, 0x16); } else { f32 damage = ((obj->maxdamage - obj->damage) + 1) / 250.0f; @@ -7702,7 +7702,7 @@ bool aiIfObjInRoom(void) u16 room_id = cmd[4] | (cmd[3] << 8); s32 room_something = chrGetPadRoom(g_Vars.chrdata, room_id); - if (room_something >= 0 && obj && obj->prop && room_something == obj->prop->room) { + if (room_something >= 0 && obj && obj->prop && room_something == obj->prop->rooms[0]) { g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[5]); } else { g_Vars.aioffset += 6; @@ -12680,7 +12680,7 @@ bool aiSetRoomToSearch(void) struct chrdata *target = chrFindById(g_Vars.chrdata, CHR_TARGET); if (target && target->prop) { - g_Vars.chrdata->roomtosearch = target->prop->room; + g_Vars.chrdata->roomtosearch = target->prop->rooms[0]; } g_Vars.aioffset += 2; @@ -12916,9 +12916,9 @@ bool ai01aa(void) f32 a = var7f1a9d9c[0]; func0f0056f4( - g_Vars.currentplayer->prop->room, + g_Vars.currentplayer->prop->rooms[0], &g_Vars.currentplayer->prop->pos, - g_Vars.chrdata->prop->room, + g_Vars.chrdata->prop->rooms[0], &g_Vars.chrdata->prop->pos, 0, &a, 0); @@ -14497,7 +14497,7 @@ bool ai01e0(void) bool ai01b4(void) { if (g_Vars.chrdata && g_Vars.chrdata->prop && - func0f01f264(g_Vars.chrdata, &g_Vars.chrdata->prop->pos, &g_Vars.chrdata->prop->room, 0, 0)) { + func0f01f264(g_Vars.chrdata, &g_Vars.chrdata->prop->pos, &g_Vars.chrdata->prop->rooms[0], 0, 0)) { u8 *cmd = g_Vars.ailist + g_Vars.aioffset; g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[2]); } else { diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index d3c9c460e..160a7ea64 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -390,7 +390,7 @@ void func0f060438(struct prop *prop) prop->next = g_Vars.unk000344; prop->prev = NULL; prop->chr = NULL; - prop->room = -1; + prop->rooms[0] = -1; g_Vars.unk000344 = prop; } diff --git a/src/include/types.h b/src/include/types.h index eb3361ea9..8f65d1551 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -24,41 +24,39 @@ struct prop; * pointer points back to the proper entity struct. */ struct prop { - u8 type; - u8 flags; - u16 unk02; + /*0x00*/ u8 type; + /*0x01*/ u8 flags; + /*0x02*/ u16 timetoregen; + /*0x04*/ union { struct chrdata *chr; struct defaultobj *obj; struct weaponobj *weapon; }; - struct coord pos; - u32 unk14; + /*0x08*/ struct coord pos; + /*0x14*/ u32 z; /*0x18*/ struct prop *parent; /*0x1c*/ struct prop *child; /*0x20*/ struct prop *next; /*0x24*/ struct prop *prev; - s16 room; - u32 unk2c; - u32 unk30; - u32 unk34; - s16 unk38; - s16 unk3a; - u8 unk3c; - u8 propstateindex; - u8 unk3e; - u8 unk3f_00 : 1; - u8 unk3f_01 : 1; - u8 unk3f_02 : 1; - u8 unk3f_03 : 1; - u8 unk3f_04 : 1; - u8 unk3f_05 : 1; - u8 unk3f_06 : 1; - u8 unk3f_07 : 1; - u32 unk40; - u32 unk44; + /*0x28*/ s16 rooms[8]; + /*0x38*/ s16 unk38; + /*0x3a*/ s16 unk3a; + /*0x3c*/ u8 unk3c; + /*0x3d*/ u8 propstateindex; + /*0x3e*/ u8 unk3e; + /*0x3f*/ u8 unk3f_00 : 1; + /*0x3f*/ u8 unk3f_01 : 1; + /*0x3f*/ u8 unk3f_02 : 1; + /*0x3f*/ u8 unk3f_03 : 1; + /*0x3f*/ u8 unk3f_04 : 1; + /*0x3f*/ u8 unk3f_05 : 1; + /*0x3f*/ u8 unk3f_06 : 1; + /*0x3f*/ u8 unk3f_07 : 1; + /*0x40*/ u32 unk40; + /*0x44*/ u32 unk44; }; struct pad {