Sanity check torsoPos to prevent phantom collisions

This commit is contained in:
MysterD 2020-09-29 18:05:37 -07:00
parent 4ade00ac78
commit a2dc5d6624

View file

@ -271,6 +271,13 @@ void bhv_mario_update(void) {
// set mario state to the current player // set mario state to the current player
gMarioState = &gMarioStates[gCurrentObject->oBehParams - 1]; gMarioState = &gMarioStates[gCurrentObject->oBehParams - 1];
// sanity check torsoPos, it isn't updated off-screen otherwise
Vec3f torsoDiff = { 0 };
vec3f_dif(torsoDiff, gMarioState->pos, gMarioState->marioBodyState->torsoPos);
if (vec3f_length(torsoDiff) > 300) {
vec3f_copy(gMarioState->marioBodyState->torsoPos, gMarioState->pos);
}
u32 particleFlags = 0; u32 particleFlags = 0;
s32 i; s32 i;