diff --git a/include/types.h b/include/types.h index 90d616197..ba2a8c8d8 100644 --- a/include/types.h +++ b/include/types.h @@ -328,6 +328,7 @@ struct MarioBodyState /*????*/ f32 lightingDirY; /*????*/ f32 lightingDirZ; /*????*/ u8 allowPartRotation; + /*????*/ bool mirrorMario; // some of these fields are updated for Mirror Mario too // u8 padding[4]; }; diff --git a/src/game/interaction.c b/src/game/interaction.c index f569ed366..c5ef686b4 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -1273,6 +1273,7 @@ static u8 resolve_player_collision(struct MarioState* m, struct MarioState* m2) f32 radius = m->marioObj->hitboxRadius * 2.0f; if (!m->marioBodyState || !m2->marioBodyState) { return FALSE; } + if (m->marioBodyState->mirrorMario || m2->marioBodyState->mirrorMario) { return FALSE; } f32* localTorso = m->marioBodyState->torsoPos; f32* remoteTorso = m2->marioBodyState->torsoPos; diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index 70c509422..8802cfbf0 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -424,6 +424,7 @@ Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) { u8 plrIdx = geo_get_processing_object_index(); struct MarioBodyState* bodyState = &gBodyStates[plrIdx]; s32 action = bodyState->action; + bodyState->mirrorMario = gCurGraphNodeObject == &gMirrorMario[plrIdx]; u8 charIndex = gNetworkPlayers[plrIdx].overrideModelIndex; if (charIndex >= CT_MAX) { charIndex = 0; } @@ -458,6 +459,7 @@ Gfx* geo_mario_head_rotation(s32 callContext, struct GraphNode* node, Mat4* c) { u8 plrIdx = geo_get_processing_object_index(); struct MarioBodyState* bodyState = &gBodyStates[plrIdx]; s32 action = bodyState->action; + bodyState->mirrorMario = gCurGraphNodeObject == &gMirrorMario[plrIdx]; bool marioActive = gMarioObjects[plrIdx] != NULL && gMarioObjects[plrIdx]->activeFlags != ACTIVE_FLAG_DEACTIVATED; @@ -805,6 +807,7 @@ Gfx* geo_mario_set_player_colors(s32 callContext, struct GraphNode* node, UNUSED gNetworkPlayerColors[index] = color; struct MarioBodyState* bodyState = &gBodyStates[index]; + bodyState->mirrorMario = gCurGraphNodeObject == &gMirrorMario[index]; if (callContext == GEO_CONTEXT_RENDER) { gfx = geo_mario_create_player_colors_dl(index, NULL, NULL); diff --git a/src/game/object_collision.c b/src/game/object_collision.c index 40b97ee11..9288cb4b0 100644 --- a/src/game/object_collision.c +++ b/src/game/object_collision.c @@ -26,6 +26,8 @@ int detect_player_hitbox_overlap(struct MarioState* local, struct MarioState* re if (!local || !remote) { return FALSE; } if (local->marioObj == NULL || local->marioObj->oIntangibleTimer != 0) { return FALSE; } if (remote->marioObj == NULL || remote->marioObj->oIntangibleTimer != 0) { return FALSE; } + if (local->marioBodyState->mirrorMario) { return FALSE; } + if (remote->marioBodyState->mirrorMario) { return FALSE; } struct Object* a = local->marioObj; f32* aTorso = local->marioBodyState->torsoPos; diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c index 019608a52..d707ab8e7 100644 --- a/src/game/object_list_processor.c +++ b/src/game/object_list_processor.c @@ -277,7 +277,7 @@ void bhv_mario_update(void) { // sanity check torsoPos, it isn't updated off-screen otherwise extern u32 gGlobalTimer; - if (gMarioState->marioBodyState && gMarioState->marioBodyState->updateTorsoTime != (gGlobalTimer - 1)) { + if (gMarioState->marioBodyState && !gMarioState->marioBodyState->mirrorMario && gMarioState->marioBodyState->updateTorsoTime != (gGlobalTimer - 1)) { vec3f_copy(gMarioState->marioBodyState->torsoPos, gMarioState->pos); } diff --git a/src/pc/nametags.c b/src/pc/nametags.c index 9bfc46eda..7f4bd3802 100644 --- a/src/pc/nametags.c +++ b/src/pc/nametags.c @@ -80,7 +80,7 @@ void nametags_render(void) { continue; } - if (m->marioBodyState->updateHeadPosTime != gGlobalTimer) { continue; } + if (m->marioBodyState->mirrorMario || m->marioBodyState->updateHeadPosTime != gGlobalTimer) { continue; } Vec3f pos; Vec3f out;