summaryrefslogtreecommitdiff
path: root/src/ship_cmd.cpp
diff options
context:
space:
mode:
authorMatt Kimber <mattkimber@users.noreply.github.com>2021-01-17 18:57:16 +0000
committerGitHub <noreply@github.com>2021-01-17 19:57:16 +0100
commit40d5fe1631ca59080ec7001b621526cbc9a26504 (patch)
tree8801fc37d2a28bd2d86e7308056c5dabdf760227 /src/ship_cmd.cpp
parent120c6fda61b631cfa68e6b13b53cdb5f29f5e9b6 (diff)
downloadopenttd-40d5fe1631ca59080ec7001b621526cbc9a26504.tar.xz
Fix eeb88e8: Trains reversed while paused do not correctly update sprite bounds (#8540)
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r--src/ship_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index e839941cf..825321e10 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -646,6 +646,8 @@ static void ShipController(Ship *v)
if ((v->tick_counter & 7) == 0) {
DirDiff diff = DirDifference(v->direction, v->rotation);
v->rotation = ChangeDir(v->rotation, diff > DIRDIFF_REVERSE ? DIRDIFF_45LEFT : DIRDIFF_45RIGHT);
+ /* Invalidate the sprite cache direction to force recalculation of viewport */
+ v->sprite_cache.last_direction = INVALID_DIR;
v->UpdateViewport(true, true);
}
return;