From ac2087a3eb548495c059d7ceb2e868c0ef201f63 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 9 Mar 2025 08:55:35 +0100 Subject: [PATCH] Codefix: remove some logically dead code --- src/viewport.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/viewport.cpp b/src/viewport.cpp index 34b6245a05..ef78013b7e 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -3088,9 +3088,9 @@ static void CalcRaildirsDrawstyle(int x, int y, int method) /* 'Build' the last half rail tile if needed */ if ((offset & TILE_UNIT_MASK) > (TILE_SIZE / 2)) { if (dx + dy >= (int)TILE_SIZE) { - x += (dx + dy < 0) ? (int)TILE_SIZE : -(int)TILE_SIZE; + x -= (int)TILE_SIZE; } else { - y += (dx + dy < 0) ? (int)TILE_SIZE : -(int)TILE_SIZE; + y += (int)TILE_SIZE; } } @@ -3122,10 +3122,10 @@ static void CalcRaildirsDrawstyle(int x, int y, int method) /* 'Build' the last half rail tile if needed */ if ((offset & TILE_UNIT_MASK) > (TILE_SIZE / 2)) { - if (dx - dy < 0) { - y += (dx > dy) ? (int)TILE_SIZE : -(int)TILE_SIZE; + if (dx < dy) { + y -= (int)TILE_SIZE; } else { - x += (dx < dy) ? (int)TILE_SIZE : -(int)TILE_SIZE; + x -= (int)TILE_SIZE; } }