From b8a490b31983bf9dc652dd849f680cee0a3819c8 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 1 Jul 2026 22:45:17 +0200 Subject: [PATCH] make this less messy --- src/k_kart.c | 9 +++++---- src/p_map.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index e1e8f9f41..212e09f16 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6325,11 +6325,12 @@ void K_KartUpdatePosition(player_t *player) if (G_RaceGametype()) { - if ((((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) > - ((player->starpostnum) + (numstarposts + 1) * player->laps))) + const INT32 iplayerlaps = (players[i].starpostnum + (numstarposts + 1) * players[i].laps); + const INT32 pplayerlaps = (player->starpostnum + (numstarposts + 1) * player->laps); + + if (iplayerlaps > pplayerlaps) position++; - else if (((players[i].starpostnum) + (numstarposts+1)*players[i].laps) == - ((player->starpostnum) + (numstarposts+1)*player->laps)) + else if (iplayerlaps == pplayerlaps) { ppcd = pncd = ipcd = incd = 0; diff --git a/src/p_map.c b/src/p_map.c index d9383cedb..1a5b9c665 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2684,7 +2684,7 @@ boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y) if (tmfloorz - thing->z > maxstep) return false; // too big a step up } - } while(tryx != x || tryy != y); + } while (tryx != x || tryy != y); // the move is ok, // so link the thing into its new position