From a10ac14462225b6a2ea587ec96aa7bc0d9897161 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Sat, 5 Jan 2019 00:42:36 -0500 Subject: [PATCH] turn these signed before abs-ing em --- src/k_kart.c | 8 ++++---- src/p_user.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 947f5067..8189cd0f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2683,7 +2683,7 @@ void K_DriftDustHandling(mobj_t *spawner) { if (spawner->player->pflags & PF_SKIDDOWN) { - anglediff = abs(spawner->angle - spawner->player->frameangle); + anglediff = abs((signed)(spawner->angle - spawner->player->frameangle)); if (leveltime % 6 == 0) S_StartSound(spawner, sfx_screec); // repeated here because it doesn't always happen to be within the range when this is the case } @@ -2697,7 +2697,7 @@ void K_DriftDustHandling(mobj_t *spawner) if (spawner->player->cmd.forwardmove < 0) playerangle += ANGLE_180; - anglediff = abs(playerangle - R_PointToAngle2(0, 0, spawner->player->rmomx, spawner->player->rmomy)); + anglediff = abs((signed)(playerangle - R_PointToAngle2(0, 0, spawner->player->rmomx, spawner->player->rmomy))); } } else @@ -2705,7 +2705,7 @@ void K_DriftDustHandling(mobj_t *spawner) if (P_AproxDistance(spawner->momx, spawner->momy) < 5<angle - R_PointToAngle2(0, 0, spawner->momx, spawner->momy)); + anglediff = abs((signed)(spawner->angle - R_PointToAngle2(0, 0, spawner->momx, spawner->momy))); } if (anglediff > ANGLE_180) @@ -7660,7 +7660,7 @@ static void K_drawLapStartAnim(void) { V_DrawFixedPatch((BASEVIDWIDTH/2 + (32*max(0, stplyr->kartstuff[k_lapanimation]-76)))*FRACUNIT, (48 - (32*max(0, progress-76)) - + 4 - abs((leveltime % 8) - 4))*FRACUNIT, + + 4 - abs((signed)((leveltime % 8) - 4)))*FRACUNIT, FRACUNIT, V_HUDTRANS, kp_lapanim_hand[stplyr->kartstuff[k_laphand]-1], NULL); } diff --git a/src/p_user.c b/src/p_user.c index 616fc721..b71f39c0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6713,7 +6713,7 @@ static void P_MovePlayer(player_t *player) if (player->mo->state != &states[S_KART_SPIN]) P_SetPlayerMobjState(player->mo, S_KART_SPIN); - if (speed == 1 && abs(player->mo->angle - player->frameangle) < ANGLE_22h) + if (speed == 1 && abs((signed)(player->mo->angle - player->frameangle)) < ANGLE_22h) player->frameangle = player->mo->angle; // Face forward at the end of the animation else player->frameangle -= (ANGLE_11hh * speed);