mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
fix nametags and collisions with mirror mario
This commit is contained in:
parent
884c39950f
commit
75b71e9b4d
6 changed files with 9 additions and 2 deletions
|
|
@ -328,6 +328,7 @@ struct MarioBodyState
|
||||||
/*????*/ f32 lightingDirY;
|
/*????*/ f32 lightingDirY;
|
||||||
/*????*/ f32 lightingDirZ;
|
/*????*/ f32 lightingDirZ;
|
||||||
/*????*/ u8 allowPartRotation;
|
/*????*/ u8 allowPartRotation;
|
||||||
|
/*????*/ bool mirrorMario; // some of these fields are updated for Mirror Mario too
|
||||||
// u8 padding[4];
|
// u8 padding[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1273,6 +1273,7 @@ static u8 resolve_player_collision(struct MarioState* m, struct MarioState* m2)
|
||||||
f32 radius = m->marioObj->hitboxRadius * 2.0f;
|
f32 radius = m->marioObj->hitboxRadius * 2.0f;
|
||||||
|
|
||||||
if (!m->marioBodyState || !m2->marioBodyState) { return FALSE; }
|
if (!m->marioBodyState || !m2->marioBodyState) { return FALSE; }
|
||||||
|
if (m->marioBodyState->mirrorMario || m2->marioBodyState->mirrorMario) { return FALSE; }
|
||||||
|
|
||||||
f32* localTorso = m->marioBodyState->torsoPos;
|
f32* localTorso = m->marioBodyState->torsoPos;
|
||||||
f32* remoteTorso = m2->marioBodyState->torsoPos;
|
f32* remoteTorso = m2->marioBodyState->torsoPos;
|
||||||
|
|
|
||||||
|
|
@ -424,6 +424,7 @@ Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
||||||
u8 plrIdx = geo_get_processing_object_index();
|
u8 plrIdx = geo_get_processing_object_index();
|
||||||
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
||||||
s32 action = bodyState->action;
|
s32 action = bodyState->action;
|
||||||
|
bodyState->mirrorMario = gCurGraphNodeObject == &gMirrorMario[plrIdx];
|
||||||
|
|
||||||
u8 charIndex = gNetworkPlayers[plrIdx].overrideModelIndex;
|
u8 charIndex = gNetworkPlayers[plrIdx].overrideModelIndex;
|
||||||
if (charIndex >= CT_MAX) { charIndex = 0; }
|
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();
|
u8 plrIdx = geo_get_processing_object_index();
|
||||||
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
||||||
s32 action = bodyState->action;
|
s32 action = bodyState->action;
|
||||||
|
bodyState->mirrorMario = gCurGraphNodeObject == &gMirrorMario[plrIdx];
|
||||||
|
|
||||||
bool marioActive = gMarioObjects[plrIdx] != NULL && gMarioObjects[plrIdx]->activeFlags != ACTIVE_FLAG_DEACTIVATED;
|
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;
|
gNetworkPlayerColors[index] = color;
|
||||||
|
|
||||||
struct MarioBodyState* bodyState = &gBodyStates[index];
|
struct MarioBodyState* bodyState = &gBodyStates[index];
|
||||||
|
bodyState->mirrorMario = gCurGraphNodeObject == &gMirrorMario[index];
|
||||||
|
|
||||||
if (callContext == GEO_CONTEXT_RENDER) {
|
if (callContext == GEO_CONTEXT_RENDER) {
|
||||||
gfx = geo_mario_create_player_colors_dl(index, NULL, NULL);
|
gfx = geo_mario_create_player_colors_dl(index, NULL, NULL);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ int detect_player_hitbox_overlap(struct MarioState* local, struct MarioState* re
|
||||||
if (!local || !remote) { return FALSE; }
|
if (!local || !remote) { return FALSE; }
|
||||||
if (local->marioObj == NULL || local->marioObj->oIntangibleTimer != 0) { return FALSE; }
|
if (local->marioObj == NULL || local->marioObj->oIntangibleTimer != 0) { return FALSE; }
|
||||||
if (remote->marioObj == NULL || remote->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;
|
struct Object* a = local->marioObj;
|
||||||
f32* aTorso = local->marioBodyState->torsoPos;
|
f32* aTorso = local->marioBodyState->torsoPos;
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,7 @@ void bhv_mario_update(void) {
|
||||||
|
|
||||||
// sanity check torsoPos, it isn't updated off-screen otherwise
|
// sanity check torsoPos, it isn't updated off-screen otherwise
|
||||||
extern u32 gGlobalTimer;
|
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);
|
vec3f_copy(gMarioState->marioBodyState->torsoPos, gMarioState->pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ void nametags_render(void) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m->marioBodyState->updateHeadPosTime != gGlobalTimer) { continue; }
|
if (m->marioBodyState->mirrorMario || m->marioBodyState->updateHeadPosTime != gGlobalTimer) { continue; }
|
||||||
|
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
Vec3f out;
|
Vec3f out;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue