From 79fdb73e63e35304b845ab56722ab270300a2188 Mon Sep 17 00:00:00 2001 From: MysterD Date: Thu, 30 Jul 2020 21:43:50 -0700 Subject: [PATCH] Fixed Mario going invisible when both are sliding --- src/game/mario.c | 2 +- src/game/obj_behaviors.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/mario.c b/src/game/mario.c index b291c132..eef2536e 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -1941,7 +1941,7 @@ skippy: void init_mario_from_save_file(void) { bool isMario = (gMarioState == &gMarioStates[0]); - gMarioState->unk00 = 0; + gMarioState->unk00 = isMario ? 0 : 1; gMarioState->flags = 0; gMarioState->action = 0; int i = isMario ? 0 : 1; diff --git a/src/game/obj_behaviors.c b/src/game/obj_behaviors.c index 601c45f1..f3774bc0 100644 --- a/src/game/obj_behaviors.c +++ b/src/game/obj_behaviors.c @@ -503,6 +503,14 @@ s32 is_point_within_radius_of_mario(f32 x, f32 y, f32 z, s32 dist) { return TRUE; } + mGfxX = gLuigiObject->header.gfx.pos[0]; + mGfxY = gLuigiObject->header.gfx.pos[1]; + mGfxZ = gLuigiObject->header.gfx.pos[2]; + + if ((x - mGfxX) * (x - mGfxX) + (y - mGfxY) * (y - mGfxY) + (z - mGfxZ) * (z - mGfxZ) + < (f32)(dist * dist)) { + return TRUE; + } return FALSE; }