Make sure it's a waypoint before doing distance calculations

This commit is contained in:
Sryder 2018-03-13 05:25:04 +00:00
parent 07c7bc05c5
commit f26c96175d
1 changed files with 3 additions and 3 deletions

View File

@ -2576,6 +2576,9 @@ static void K_KartUpdatePosition(player_t *player)
mo = (mobj_t *)th;
if (mo->type != MT_BOSS3WAYPOINT) // TODO: Change to 'MT_WAYPOINT'?
continue;
pmo = P_AproxDistance(P_AproxDistance( mo->x - player->mo->x,
mo->y - player->mo->y),
mo->z - player->mo->z) / FRACUNIT;
@ -2583,9 +2586,6 @@ static void K_KartUpdatePosition(player_t *player)
mo->y - players[i].mo->y),
mo->z - players[i].mo->z) / FRACUNIT;
if (mo->type != MT_BOSS3WAYPOINT) // TODO: Change to 'MT_WAYPOINT'?
continue;
if (mo->health == player->starpostnum)
{
player->kartstuff[k_prevcheck] += pmo;