diff --git a/src/game/game_0b63b0.c b/src/game/game_0b63b0.c index a9bfbe3e7..5e24cb1f1 100644 --- a/src/game/game_0b63b0.c +++ b/src/game/game_0b63b0.c @@ -1130,7 +1130,7 @@ glabel func0f0b69d0 /* f0b6b9c: 926e0000 */ lbu $t6,0x0($s3) /* f0b6ba0: 55c00006 */ bnezl $t6,.L0f0b6bbc /* f0b6ba4: a2f40000 */ sb $s4,0x0($s7) -/* f0b6ba8: 0fc57602 */ jal func0f15d808 +/* f0b6ba8: 0fc57602 */ jal roomIsVisibleByAibot /* f0b6bac: 8fa40118 */ lw $a0,0x118($sp) /* f0b6bb0: 50400003 */ beqzl $v0,.L0f0b6bc0 /* f0b6bb4: 8faf0138 */ lw $t7,0x138($sp) diff --git a/src/game/game_157db0.c b/src/game/game_157db0.c index e7da5ba9d..0e9f51a5c 100644 --- a/src/game/game_157db0.c +++ b/src/game/game_157db0.c @@ -6140,36 +6140,14 @@ glabel roomIsVisibleByPlayer /* f15d804: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f15d808 -/* f15d808: 3c0e800a */ lui $t6,%hi(g_Vars+0x314) -/* f15d80c: 8dcea2d4 */ lw $t6,%lo(g_Vars+0x314)($t6) -/* f15d810: 000460c0 */ sll $t4,$a0,0x3 -/* f15d814: 01846021 */ addu $t4,$t4,$a0 -/* f15d818: 11c0000b */ beqz $t6,.L0f15d848 -/* f15d81c: 3c0b800a */ lui $t3,%hi(g_Rooms) -/* f15d820: 3c0f800a */ lui $t7,%hi(g_MpRoomVisibility) -/* f15d824: 8def492c */ lw $t7,%lo(g_MpRoomVisibility)($t7) -/* f15d828: 24080010 */ addiu $t0,$zero,0x10 -/* f15d82c: 00a84804 */ sllv $t1,$t0,$a1 -/* f15d830: 01e4c021 */ addu $t8,$t7,$a0 -/* f15d834: 93190000 */ lbu $t9,0x0($t8) -/* f15d838: 03291024 */ and $v0,$t9,$t1 -/* f15d83c: 0002502b */ sltu $t2,$zero,$v0 -/* f15d840: 03e00008 */ jr $ra -/* f15d844: 01401025 */ or $v0,$t2,$zero -.L0f15d848: -/* f15d848: 8d6b4928 */ lw $t3,%lo(g_Rooms)($t3) -/* f15d84c: 000c6080 */ sll $t4,$t4,0x2 -/* f15d850: 01846023 */ subu $t4,$t4,$a0 -/* f15d854: 000c6080 */ sll $t4,$t4,0x2 -/* f15d858: 016c6821 */ addu $t5,$t3,$t4 -/* f15d85c: 95a20000 */ lhu $v0,0x0($t5) -/* f15d860: 304e0008 */ andi $t6,$v0,0x8 -/* f15d864: 01c01025 */ or $v0,$t6,$zero -/* f15d868: 03e00008 */ jr $ra -/* f15d86c: 00000000 */ sll $zero,$zero,0x0 -); +bool roomIsVisibleByAibot(u32 room, u32 aibotindex) +{ + if (g_Vars.mplayerisrunning) { + return (g_MpRoomVisibility[room] & (0x10 << aibotindex)) != 0; + } + + return g_Rooms[room].flags & ROOMFLAG_0008; +} GLOBAL_ASM( glabel func0f15d870 diff --git a/src/include/constants.h b/src/include/constants.h index 00bf1b7ab..05b3174da 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -1864,6 +1864,7 @@ #define ROOMFLAG_DISABLED 0x0001 #define ROOMFLAG_ACTIVE 0x0004 +#define ROOMFLAG_0008 0x0008 #define ROOMFLAG_4000 0x4000 #define ROOMFLAG_8000 0x8000 diff --git a/src/include/game/game_157db0.h b/src/include/game/game_157db0.h index 18cf311bc..4d280c309 100644 --- a/src/include/game/game_157db0.h +++ b/src/include/game/game_157db0.h @@ -47,7 +47,7 @@ void boxCopy(struct screenbox *dst, struct screenbox *src); bool roomIsActive(s32 room_id); u32 func0f15d744(void); bool roomIsVisibleByPlayer(s16 room, u32 playernum); -u32 func0f15d808(void); +bool roomIsVisibleByAibot(u32 room, u32 aibotindex); u32 func0f15d870(void); u32 func0f15d9a8(void); u32 func0f15da00(void);