mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-08-30 16:59:49 -04:00
Discover if_lift_at_stop AI command and attempt to decompile aiIfLiftAtStop
This commit is contained in:
@@ -12164,7 +12164,7 @@ bool aiIfLiftStationary(void)
|
||||
if (obj && obj->prop && obj->type == OBJTYPE_LIFT) {
|
||||
struct liftobj *lift = (struct liftobj *)obj;
|
||||
|
||||
if ((obj->flags & OBJFLAG_DEACTIVATED) || !lift->unk74) {
|
||||
if ((obj->flags & OBJFLAG_DEACTIVATED) || lift->dist == 0) {
|
||||
pass = true;
|
||||
}
|
||||
}
|
||||
@@ -12199,7 +12199,7 @@ bool ai0189(void)
|
||||
* @cmd 018a
|
||||
*/
|
||||
GLOBAL_ASM(
|
||||
glabel ai018a
|
||||
glabel aiIfLiftAtStop
|
||||
/* f05d30c: 3c03800a */ lui $v1,%hi(g_Vars)
|
||||
/* f05d310: 24639fc0 */ addiu $v1,$v1,%lo(g_Vars)
|
||||
/* f05d314: 8c6e0434 */ lw $t6,0x434($v1)
|
||||
@@ -12256,6 +12256,30 @@ glabel ai018a
|
||||
/* f05d3d4: 00000000 */ sll $zero,$zero,0x0
|
||||
);
|
||||
|
||||
// Mismatch because the load order of lift->levelcur and cmd[3] are swapped
|
||||
//bool aiIfLiftAtStop(void)
|
||||
//{
|
||||
// u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
|
||||
// struct defaultobj *obj = objFindByTagId(cmd[2]);
|
||||
// bool pass = false;
|
||||
//
|
||||
// if (obj && obj->prop && obj->type == OBJTYPE_LIFT) {
|
||||
// struct liftobj *lift = (struct liftobj *)obj;
|
||||
//
|
||||
// if (lift->levelcur == cmd[3] && lift->dist == 0) {
|
||||
// pass = true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (pass) {
|
||||
// g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[4]);
|
||||
// } else {
|
||||
// g_Vars.aioffset += 5;
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
//}
|
||||
|
||||
/**
|
||||
* @cmd 018b
|
||||
*/
|
||||
|
||||
@@ -6613,7 +6613,7 @@ bool (*g_CommandPointers[])(void) = {
|
||||
/*0x0187*/ ai0187,
|
||||
/*0x0188*/ aiIfLiftStationary,
|
||||
/*0x0189*/ ai0189,
|
||||
/*0x018a*/ ai018a,
|
||||
/*0x018a*/ aiIfLiftAtStop,
|
||||
/*0x018b*/ aiConfigureRain,
|
||||
/*0x018c*/ aiChrToggleProp,
|
||||
/*0x018d*/ aiActivateLift,
|
||||
|
||||
Reference in New Issue
Block a user