From d7224dbe849deccdf003896856720755bf37bda2 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 11 Feb 2020 22:14:38 +1000 Subject: [PATCH] Discover proptypes explosion and effect --- src/game/chr/chraicommands.c | 4 ++-- src/game/game_005fd0.c | 2 +- src/game/game_01e250.c | 2 +- src/game/game_02cde0.c | 6 +++--- src/game/game_0601b0.c | 4 ++-- src/game/game_066310.c | 10 +++++----- src/game/game_129900.c | 2 +- src/game/game_157db0.c | 2 +- src/game/game_190260.c | 2 +- src/game/game_19c990.c | 6 +++--- src/include/commands.h | 9 +++++---- src/include/constants.h | 15 ++++++++------- src/include/game/game_0601b0.h | 2 +- src/library/library_233c0.c | 16 ++++++++-------- 14 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 933176eaa..92c3c6058 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -1794,7 +1794,7 @@ bool aiIfSeesSuspiciousItem(void) s16 propnums[256]; struct prop *chrprop = g_Vars.chrdata->prop; - func0f065f80(&chrprop->rooms[0], &propnums[0], 256); + roomGetProps(&chrprop->rooms[0], &propnums[0], 256); ptr = &propnums[0]; @@ -1811,7 +1811,7 @@ bool aiIfSeesSuspiciousItem(void) && func0f039558(g_Vars.chrdata, prop)) { pass = true; } - } else if (prop->type == PROPTYPE_7) { + } else if (prop->type == PROPTYPE_EXPLOSION) { if (func0f039558(g_Vars.chrdata, prop)) { pass = true; } diff --git a/src/game/game_005fd0.c b/src/game/game_005fd0.c index 9245efeba..da9052b9c 100644 --- a/src/game/game_005fd0.c +++ b/src/game/game_005fd0.c @@ -4162,7 +4162,7 @@ glabel func0f0099e4 /* f009ba4: 27b00100 */ addiu $s0,$sp,0x100 /* f009ba8: a58a0000 */ sh $t2,0x0($t4) /* f009bac: 02002825 */ or $a1,$s0,$zero -/* f009bb0: 0fc197e0 */ jal func0f065f80 +/* f009bb0: 0fc197e0 */ jal roomGetProps /* f009bb4: 24060100 */ addiu $a2,$zero,0x100 /* f009bb8: 87ad0100 */ lh $t5,0x100($sp) /* f009bbc: 02009825 */ or $s3,$s0,$zero diff --git a/src/game/game_01e250.c b/src/game/game_01e250.c index 0c4388a4d..a371d8aa2 100644 --- a/src/game/game_01e250.c +++ b/src/game/game_01e250.c @@ -6821,7 +6821,7 @@ glabel func0f024738 /* f0247c0: 26b52960 */ addiu $s5,$s5,%lo(var80062960) /* f0247c4: 02002825 */ or $a1,$s0,$zero /* f0247c8: 24060100 */ addiu $a2,$zero,0x100 -/* f0247cc: 0fc197e0 */ jal func0f065f80 +/* f0247cc: 0fc197e0 */ jal roomGetProps /* f0247d0: 24840028 */ addiu $a0,$a0,0x28 /* f0247d4: 87a9007c */ lh $t1,0x7c($sp) /* f0247d8: 0200a025 */ or $s4,$s0,$zero diff --git a/src/game/game_02cde0.c b/src/game/game_02cde0.c index c9c053e97..d9d292d87 100644 --- a/src/game/game_02cde0.c +++ b/src/game/game_02cde0.c @@ -15791,7 +15791,7 @@ glabel func0f03b1e0 /* f03b23c: 26640028 */ addiu $a0,$s3,0x28 /* f03b240: afa4004c */ sw $a0,0x4c($sp) /* f03b244: 02e02825 */ or $a1,$s7,$zero -/* f03b248: 0fc197e0 */ jal func0f065f80 +/* f03b248: 0fc197e0 */ jal roomGetProps /* f03b24c: 24060100 */ addiu $a2,$zero,0x100 /* f03b250: 87ae00a8 */ lh $t6,0xa8($sp) /* f03b254: 00008825 */ or $s1,$zero,$zero @@ -25296,7 +25296,7 @@ bool chrDetectDangerousObject(struct chrdata *chr, u8 flags) pass = true; } - if ((flags & 2) && prop->type == PROPTYPE_7) { + if ((flags & 2) && prop->type == PROPTYPE_EXPLOSION) { pass = true; } @@ -32609,7 +32609,7 @@ glabel func0f04a848 .L0f04a920: /* f04a920: 02002825 */ or $a1,$s0,$zero /* f04a924: 02602025 */ or $a0,$s3,$zero -/* f04a928: 0fc197e0 */ jal func0f065f80 +/* f04a928: 0fc197e0 */ jal roomGetProps /* f04a92c: 24060100 */ addiu $a2,$zero,0x100 /* f04a930: 87af00e0 */ lh $t7,0xe0($sp) /* f04a934: 02009025 */ or $s2,$s0,$zero diff --git a/src/game/game_0601b0.c b/src/game/game_0601b0.c index 3da8cdf84..21a830127 100644 --- a/src/game/game_0601b0.c +++ b/src/game/game_0601b0.c @@ -4729,7 +4729,7 @@ glabel func0f0641f4 .L0f0642bc: /* f0642bc: 02002825 */ or $a1,$s0,$zero /* f0642c0: 02602025 */ or $a0,$s3,$zero -/* f0642c4: 0fc197e0 */ jal func0f065f80 +/* f0642c4: 0fc197e0 */ jal roomGetProps /* f0642c8: 24060100 */ addiu $a2,$zero,0x100 /* f0642cc: 87ac0088 */ lh $t4,0x88($sp) /* f0642d0: 02008825 */ or $s1,$s0,$zero @@ -6796,7 +6796,7 @@ glabel func0f065e98 ); GLOBAL_ASM( -glabel func0f065f80 +glabel roomGetProps /* f065f80: afa60008 */ sw $a2,0x8($sp) /* f065f84: 84830000 */ lh $v1,0x0($a0) /* f065f88: 240affff */ addiu $t2,$zero,-1 diff --git a/src/game/game_066310.c b/src/game/game_066310.c index 7248604ed..e0d95237a 100644 --- a/src/game/game_066310.c +++ b/src/game/game_066310.c @@ -8762,7 +8762,7 @@ glabel func0f06c8ac /* f06c9f8: 27b000ac */ addiu $s0,$sp,0xac /* f06c9fc: 02002825 */ or $a1,$s0,$zero /* f06ca00: 8fa402d0 */ lw $a0,0x2d0($sp) -/* f06ca04: 0fc197e0 */ jal func0f065f80 +/* f06ca04: 0fc197e0 */ jal roomGetProps /* f06ca08: 24060100 */ addiu $a2,$zero,0x100 /* f06ca0c: 87ae00ac */ lh $t6,0xac($sp) /* f06ca10: 0200a825 */ or $s5,$s0,$zero @@ -16003,7 +16003,7 @@ glabel func0f0732d4 /* f07331c: 26fe0028 */ addiu $s8,$s7,0x28 /* f073320: 03c02025 */ or $a0,$s8,$zero /* f073324: 02002825 */ or $a1,$s0,$zero -/* f073328: 0fc197e0 */ jal func0f065f80 +/* f073328: 0fc197e0 */ jal roomGetProps /* f07332c: 24060100 */ addiu $a2,$zero,0x100 /* f073330: 87ae00a0 */ lh $t6,0xa0($sp) /* f073334: 0200b025 */ or $s6,$s0,$zero @@ -34626,7 +34626,7 @@ glabel func0f0840ac /* f0840ec: 27b00050 */ addiu $s0,$sp,0x50 /* f0840f0: 26c40028 */ addiu $a0,$s6,0x28 /* f0840f4: 02002825 */ or $a1,$s0,$zero -/* f0840f8: 0fc197e0 */ jal func0f065f80 +/* f0840f8: 0fc197e0 */ jal roomGetProps /* f0840fc: 24060100 */ addiu $a2,$zero,0x100 /* f084100: 87ae0050 */ lh $t6,0x50($sp) /* f084104: 02008825 */ or $s1,$s0,$zero @@ -43778,7 +43778,7 @@ glabel func0f08c040 /* f08c078: 27b20058 */ addiu $s2,$sp,0x58 /* f08c07c: 02402825 */ or $a1,$s2,$zero /* f08c080: 24060100 */ addiu $a2,$zero,0x100 -/* f08c084: 0fc197e0 */ jal func0f065f80 +/* f08c084: 0fc197e0 */ jal roomGetProps /* f08c088: 24840028 */ addiu $a0,$a0,0x28 /* f08c08c: 87ae0058 */ lh $t6,0x58($sp) /* f08c090: 02408025 */ or $s0,$s2,$zero @@ -43875,7 +43875,7 @@ glabel func0f08c190 /* f08c1d0: 27b00068 */ addiu $s0,$sp,0x68 /* f08c1d4: 02002825 */ or $a1,$s0,$zero /* f08c1d8: 24060100 */ addiu $a2,$zero,0x100 -/* f08c1dc: 0fc197e0 */ jal func0f065f80 +/* f08c1dc: 0fc197e0 */ jal roomGetProps /* f08c1e0: 24840028 */ addiu $a0,$a0,0x28 /* f08c1e4: 87af0068 */ lh $t7,0x68($sp) /* f08c1e8: 0200b825 */ or $s7,$s0,$zero diff --git a/src/game/game_129900.c b/src/game/game_129900.c index 08ede1279..f87c8f663 100644 --- a/src/game/game_129900.c +++ b/src/game/game_129900.c @@ -2669,7 +2669,7 @@ glabel func0f12b0e0 /* f12b3a4: 27b00198 */ addiu $s0,$sp,0x198 /* f12b3a8: 02002825 */ or $a1,$s0,$zero /* f12b3ac: 26e40028 */ addiu $a0,$s7,0x28 -/* f12b3b0: 0fc197e0 */ jal func0f065f80 +/* f12b3b0: 0fc197e0 */ jal roomGetProps /* f12b3b4: 24060100 */ addiu $a2,$zero,0x100 /* f12b3b8: 87aa0198 */ lh $t2,0x198($sp) /* f12b3bc: 0200a025 */ or $s4,$s0,$zero diff --git a/src/game/game_157db0.c b/src/game/game_157db0.c index 929b5278e..025d22c68 100644 --- a/src/game/game_157db0.c +++ b/src/game/game_157db0.c @@ -161,7 +161,7 @@ glabel func0f157db0 /* f157ddc: a7ae023a */ sh $t6,0x23a($sp) /* f157de0: 27a40238 */ addiu $a0,$sp,0x238 /* f157de4: 02202825 */ or $a1,$s1,$zero -/* f157de8: 0fc197e0 */ jal func0f065f80 +/* f157de8: 0fc197e0 */ jal roomGetProps /* f157dec: 24060100 */ addiu $a2,$zero,0x100 /* f157df0: 87af0038 */ lh $t7,0x38($sp) /* f157df4: 02208025 */ or $s0,$s1,$zero diff --git a/src/game/game_190260.c b/src/game/game_190260.c index 64dcd8329..4de02a8ce 100644 --- a/src/game/game_190260.c +++ b/src/game/game_190260.c @@ -1311,7 +1311,7 @@ glabel func0f19124c .L0f1912e0: /* f1912e0: 02002825 */ or $a1,$s0,$zero /* f1912e4: 02602025 */ or $a0,$s3,$zero -/* f1912e8: 0fc197e0 */ jal func0f065f80 +/* f1912e8: 0fc197e0 */ jal roomGetProps /* f1912ec: 24060100 */ addiu $a2,$zero,0x100 /* f1912f0: 87b90090 */ lh $t9,0x90($sp) /* f1912f4: 02008825 */ or $s1,$s0,$zero diff --git a/src/game/game_19c990.c b/src/game/game_19c990.c index bf1aa4382..8d85abdb9 100644 --- a/src/game/game_19c990.c +++ b/src/game/game_19c990.c @@ -3020,7 +3020,7 @@ glabel func0f19ecdc .L0f19ee18: /* f19ee18: 02002825 */ or $a1,$s0,$zero /* f19ee1c: 02402025 */ or $a0,$s2,$zero -/* f19ee20: 0fc197e0 */ jal func0f065f80 +/* f19ee20: 0fc197e0 */ jal roomGetProps /* f19ee24: 24060100 */ addiu $a2,$zero,0x100 /* f19ee28: 87b80098 */ lh $t8,0x98($sp) /* f19ee2c: 02009025 */ or $s2,$s0,$zero @@ -3670,7 +3670,7 @@ glabel func0f19f524 /* f19f714: 27a40064 */ addiu $a0,$sp,0x64 .L0f19f718: /* f19f718: 27a50090 */ addiu $a1,$sp,0x90 -/* f19f71c: 0fc197e0 */ jal func0f065f80 +/* f19f71c: 0fc197e0 */ jal roomGetProps /* f19f720: 24060100 */ addiu $a2,$zero,0x100 /* f19f724: 87ae0090 */ lh $t6,0x90($sp) /* f19f728: 27b90090 */ addiu $t9,$sp,0x90 @@ -6908,7 +6908,7 @@ glabel func0f1a22d4 /* f1a2384: 02202825 */ or $a1,$s1,$zero /* f1a2388: 02402025 */ or $a0,$s2,$zero /* f1a238c: 24060100 */ addiu $a2,$zero,0x100 -/* f1a2390: 0fc197e0 */ jal func0f065f80 +/* f1a2390: 0fc197e0 */ jal roomGetProps /* f1a2394: ad401c08 */ sw $zero,0x1c08($t2) /* f1a2398: 87ab0050 */ lh $t3,0x50($sp) /* f1a239c: 02208025 */ or $s0,$s1,$zero diff --git a/src/include/commands.h b/src/include/commands.h index e55157f26..bdfe24bc9 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -2702,15 +2702,16 @@ label, /** - * Checks if there is a live grenade or other dangerous object nearby. If so, - * the position of the object is stored in the chr's runfrompos property and the - * command passes. + * Checks if there is a live grenade or explosion nearby. If so, the position of + * the object is stored in the chr's runfrompos property and the command passes. * * The flags argument is a bitfield which specifies what types of objects to * look for. * * Flag 0x1 = check for grenades - * Flag 0x2 = check for prop type 7 (unsure what this is at the moment) + * Flag 0x2 = check for explosions + * + * Set to 0x3 to check for both. * * Those are the only supported flags. */ diff --git a/src/include/constants.h b/src/include/constants.h index ec6a8bd5c..a739be05b 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -1530,13 +1530,14 @@ #define PROPFLAG_40 0x40 #define PROPFLAG_80 0x80 -#define PROPTYPE_OBJ 1 -#define PROPTYPE_DOOR 2 -#define PROPTYPE_CHR 3 -#define PROPTYPE_WEAPON 4 -#define PROPTYPE_EYESPY 5 -#define PROPTYPE_PLAYER 6 -#define PROPTYPE_7 7 +#define PROPTYPE_OBJ 1 +#define PROPTYPE_DOOR 2 +#define PROPTYPE_CHR 3 +#define PROPTYPE_WEAPON 4 +#define PROPTYPE_EYESPY 5 +#define PROPTYPE_PLAYER 6 +#define PROPTYPE_EXPLOSION 7 +#define PROPTYPE_EFFECT 8 #define RACE_HUMAN 0 #define RACE_SKEDAR 1 diff --git a/src/include/game/game_0601b0.h b/src/include/game/game_0601b0.h index 9295ce428..d69e2c55c 100644 --- a/src/include/game/game_0601b0.h +++ b/src/include/game/game_0601b0.h @@ -53,7 +53,7 @@ u32 func0f065dd8(void); u32 func0f065dfc(void); u32 func0f065e74(void); u32 func0f065e98(void); -void func0f065f80(s16 *room, s16 *propnums, u32 size); +void roomGetProps(s16 *room, s16 *propnums, u32 size); u32 func0f066054(void); void propGetBbox(struct prop *prop, f32 *width, f32 *ymax, f32 *ymin); u32 func0f066290(void); diff --git a/src/library/library_233c0.c b/src/library/library_233c0.c index cf7c329d5..29d7846af 100644 --- a/src/library/library_233c0.c +++ b/src/library/library_233c0.c @@ -3751,7 +3751,7 @@ glabel func0002671c /* 2676c: 8fa40278 */ lw $a0,0x278($sp) /* 26770: 02002825 */ or $a1,$s0,$zero /* 26774: 24060100 */ addiu $a2,$zero,0x100 -/* 26778: 0fc197e0 */ jal func0f065f80 +/* 26778: 0fc197e0 */ jal roomGetProps /* 2677c: 24840028 */ addiu $a0,$a0,0x28 /* 26780: 87ae006c */ lh $t6,0x6c($sp) /* 26784: afb00064 */ sw $s0,0x64($sp) @@ -4318,7 +4318,7 @@ glabel func00026e7c /* 26f98: 27b60274 */ addiu $s6,$sp,0x274 /* 26f9c: 02002825 */ or $a1,$s0,$zero /* 26fa0: 8fa4028c */ lw $a0,0x28c($sp) -/* 26fa4: 0fc197e0 */ jal func0f065f80 +/* 26fa4: 0fc197e0 */ jal roomGetProps /* 26fa8: 24060100 */ addiu $a2,$zero,0x100 /* 26fac: 87ad0064 */ lh $t5,0x64($sp) /* 26fb0: 02008825 */ or $s1,$s0,$zero @@ -5342,7 +5342,7 @@ glabel func00027d1c /* 27e58: c7b602c4 */ lwc1 $f22,0x2c4($sp) /* 27e5c: 02002825 */ or $a1,$s0,$zero /* 27e60: 8fa402b0 */ lw $a0,0x2b0($sp) -/* 27e64: 0fc197e0 */ jal func0f065f80 +/* 27e64: 0fc197e0 */ jal roomGetProps /* 27e68: 24060100 */ addiu $a2,$zero,0x100 /* 27e6c: 87b90090 */ lh $t9,0x90($sp) /* 27e70: 02008825 */ or $s1,$s0,$zero @@ -6508,7 +6508,7 @@ glabel func00028df0 /* 28f1c: c7b602bc */ lwc1 $f22,0x2bc($sp) /* 28f20: 02002825 */ or $a1,$s0,$zero /* 28f24: 8fa402a8 */ lw $a0,0x2a8($sp) -/* 28f28: 0fc197e0 */ jal func0f065f80 +/* 28f28: 0fc197e0 */ jal roomGetProps /* 28f2c: 24060100 */ addiu $a2,$zero,0x100 /* 28f30: 87af0088 */ lh $t7,0x88($sp) /* 28f34: 02008825 */ or $s1,$s0,$zero @@ -11194,7 +11194,7 @@ glabel func0002d15c /* 2d2b4: c7b602b8 */ lwc1 $f22,0x2b8($sp) /* 2d2b8: 02202825 */ or $a1,$s1,$zero /* 2d2bc: 8fa402a0 */ lw $a0,0x2a0($sp) -/* 2d2c0: 0fc197e0 */ jal func0f065f80 +/* 2d2c0: 0fc197e0 */ jal roomGetProps /* 2d2c4: 24060100 */ addiu $a2,$zero,0x100 /* 2d2c8: 87b80078 */ lh $t8,0x78($sp) /* 2d2cc: 02208025 */ or $s0,$s1,$zero @@ -11376,7 +11376,7 @@ glabel func0002d3b0 /* 2d558: c7b60300 */ lwc1 $f22,0x300($sp) /* 2d55c: 02002825 */ or $a1,$s0,$zero /* 2d560: 03c02025 */ or $a0,$s8,$zero -/* 2d564: 0fc197e0 */ jal func0f065f80 +/* 2d564: 0fc197e0 */ jal roomGetProps /* 2d568: 24060100 */ addiu $a2,$zero,0x100 /* 2d56c: 87af0090 */ lh $t7,0x90($sp) /* 2d570: 02008825 */ or $s1,$s0,$zero @@ -12550,7 +12550,7 @@ glabel func0002e4c4 /* 2e5a0: 27b10054 */ addiu $s1,$sp,0x54 /* 2e5a4: 02c02025 */ or $a0,$s6,$zero /* 2e5a8: 02202825 */ or $a1,$s1,$zero -/* 2e5ac: 0fc197e0 */ jal func0f065f80 +/* 2e5ac: 0fc197e0 */ jal roomGetProps /* 2e5b0: 24060100 */ addiu $a2,$zero,0x100 /* 2e5b4: 87ad0054 */ lh $t5,0x54($sp) /* 2e5b8: 02208025 */ or $s0,$s1,$zero @@ -13419,7 +13419,7 @@ glabel func0002f02c /* 2f1f4: 02002825 */ or $a1,$s0,$zero /* 2f1f8: 8fa4034c */ lw $a0,0x34c($sp) /* 2f1fc: 24060100 */ addiu $a2,$zero,0x100 -/* 2f200: 0fc197e0 */ jal func0f065f80 +/* 2f200: 0fc197e0 */ jal roomGetProps /* 2f204: afa9012c */ sw $t1,0x12c($sp) /* 2f208: 87ab0134 */ lh $t3,0x134($sp) /* 2f20c: 8fa9012c */ lw $t1,0x12c($sp)