Fix eeb88e8: Trains reversed while paused do not correctly update sprite bounds (#8540)

This commit is contained in:
Matt Kimber
2021-01-17 18:57:16 +00:00
committed by GitHub
parent 120c6fda61
commit 40d5fe1631
6 changed files with 105 additions and 68 deletions

View File

@@ -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;