From 78e2021f4b2c8a930dbcfdce2b7e3c7aa0519585 Mon Sep 17 00:00:00 2001 From: Sryder Date: Tue, 13 Mar 2018 05:25:04 +0000 Subject: [PATCH] Make sure it's a waypoint before doing distance calculations --- src/k_kart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 8cc8e4186..4f04f46a2 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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;