Merge branch 'fix-spectator-offroad' into 'master'

Fix spectators spawning offroad particles

Closes #394

See merge request KartKrew/Kart!865
This commit is contained in:
James R 2023-01-10 02:45:04 +00:00
commit 19a85c25e2

View file

@ -966,26 +966,13 @@ void K_HandleFootstepParticles(mobj_t *mo)
return;
}
if (!(mo->flags & MF_APPLYTERRAIN))
if (!(mo->flags & MF_APPLYTERRAIN) || mo->terrain == NULL)
{
// No TERRAIN effects for this object.
return;
}
if (mo->terrain == NULL || mo->terrain->footstepID == SIZE_MAX)
{
// If no terrain, check for offroad.
// If we're in offroad, use the default particle.
if (mo->player != NULL && mo->player->boostpower < FRACUNIT)
{
fs = K_GetFootstepByIndex(defaultOffroadFootstep);
}
}
else
{
fs = K_GetFootstepByIndex(mo->terrain->footstepID);
}
fs = K_GetFootstepByIndex(mo->terrain->footstepID);
if (fs == NULL || fs->mobjType == MT_NULL || fs->frequency <= 0)
{