From a6d1d128dae5a8a329def0b1c4d3c257267a928b Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 16 Oct 2016 14:56:33 +0000 Subject: [PATCH] (svn r27663) -Codechange: Deduplicate code when rotating crashed vehicles. --- src/train_cmd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index dca456d976..699f0c144c 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -3521,14 +3521,14 @@ static void ChangeTrainDirRandomly(Train *v) /* We don't need to twist around vehicles if they're not visible */ if (!(v->vehstatus & VS_HIDDEN)) { v->direction = ChangeDir(v->direction, delta[GB(Random(), 0, 2)]); - v->UpdateDeltaXY(v->direction); - v->cur_image = v->GetImage(v->direction, EIT_ON_MAP); /* Refrain from updating the z position of the vehicle when on * a bridge, because UpdateInclination() will put the vehicle under * the bridge in that case */ if (v->track != TRACK_BIT_WORMHOLE) { v->UpdatePosition(); - v->UpdateInclination(false, false); + v->UpdateInclination(false, true); + } else { + v->UpdateViewport(false, true); } } } while ((v = v->Next()) != NULL);