diff --git a/src/game/dlights.c b/src/game/dlights.c index 299f73901..ec7044b12 100644 --- a/src/game/dlights.c +++ b/src/game/dlights.c @@ -471,28 +471,18 @@ glabel func0f000dfc /* f000f4c: e4d00008 */ swc1 $f16,0x8($a2) ); -GLOBAL_ASM( -glabel func0f000f50 -/* f000f50: 27bdffe8 */ addiu $sp,$sp,-24 -/* f000f54: 10800009 */ beqz $a0,.L0f000f7c -/* f000f58: afbf0014 */ sw $ra,0x14($sp) -/* f000f5c: 0fc0025f */ jal roomGetLight -/* f000f60: 00000000 */ nop -/* f000f64: 944e0004 */ lhu $t6,0x4($v0) -/* f000f68: 000ec640 */ sll $t8,$t6,0x19 -/* f000f6c: 07030004 */ bgezl $t8,.L0f000f80 -/* f000f70: 00001825 */ or $v1,$zero,$zero -/* f000f74: 10000002 */ b .L0f000f80 -/* f000f78: 24030001 */ addiu $v1,$zero,0x1 -.L0f000f7c: -/* f000f7c: 00001825 */ or $v1,$zero,$zero -.L0f000f80: -/* f000f80: 8fbf0014 */ lw $ra,0x14($sp) -/* f000f84: 27bd0018 */ addiu $sp,$sp,0x18 -/* f000f88: 00601025 */ or $v0,$v1,$zero -/* f000f8c: 03e00008 */ jr $ra -/* f000f90: 00000000 */ nop -); +bool lightIsHealthy(s32 roomnum, s32 lightnum) +{ + bool healthy; + + if (roomnum && roomGetLight(roomnum, lightnum)->healthy) { + healthy = true; + } else { + healthy = false; + } + + return healthy; +} bool func0f000f94(s32 roomnum, s32 lightnum) { diff --git a/src/game/explosion.c b/src/game/explosion.c index 5bf83fa16..10b9c3659 100644 --- a/src/game/explosion.c +++ b/src/game/explosion.c @@ -1510,7 +1510,7 @@ glabel var7f1b559c /* f12b300: 4606c601 */ sub.s $f24,$f24,$f6 /* f12b304: 02202025 */ or $a0,$s1,$zero .L0f12b308: -/* f12b308: 0fc003d4 */ jal func0f000f50 +/* f12b308: 0fc003d4 */ jal lightIsHealthy /* f12b30c: 02002825 */ or $a1,$s0,$zero /* f12b310: 1040001c */ beqz $v0,.L0f12b384 /* f12b314: 02202025 */ or $a0,$s1,$zero diff --git a/src/game/game_13c510.c b/src/game/game_13c510.c index 053d3852f..9e44a9137 100644 --- a/src/game/game_13c510.c +++ b/src/game/game_13c510.c @@ -1392,7 +1392,7 @@ glabel func0f13d568 /* f13d838: 87190010 */ lh $t9,0x10($t8) /* f13d83c: 02392823 */ subu $a1,$s1,$t9 /* f13d840: 46083602 */ mul.s $f24,$f6,$f8 -/* f13d844: 0fc003d4 */ jal func0f000f50 +/* f13d844: 0fc003d4 */ jal lightIsHealthy /* f13d848: 00000000 */ nop /* f13d84c: 1040000f */ beqz $v0,.L0f13d88c /* f13d850: 3c19800a */ lui $t9,%hi(g_Rooms) diff --git a/src/include/game/dlights.h b/src/include/game/dlights.h index 136c2266e..bf86c26f9 100644 --- a/src/include/game/dlights.h +++ b/src/include/game/dlights.h @@ -13,7 +13,7 @@ s32 func0f000c54(s32 roomnum); u32 func0f000cc4(void); f32 func0f000dbc(s32 roomnum); u32 func0f000dfc(void); -u32 func0f000f50(void); +bool lightIsHealthy(s32 roomnum, s32 lightnum); bool func0f000f94(s32 roomnum, s32 lightnum); bool lightIsOn(s32 roomnum, s32 lightnum); u32 func0f001000(void);