From 40c99956ed05e97b21282788743557174e380f6f Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 23 Sep 2017 11:39:59 +0100 Subject: [PATCH] TBTR: Fix attempting to get sprite for new virtual engine before marking as virtual --- src/train_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 754ccb3a25..677401bca1 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -4209,8 +4209,6 @@ Train* CmdBuildVirtualRailVehicle(EngineID eid, bool lax_engine_check, StringID v->SetFrontEngine(); v->SetEngine(); - v->UpdateViewport(true, false); - if (rvi->railveh_type == RAILVEH_MULTIHEAD) { AddRearEngineToMultiheadedTrain(v); } else { @@ -4222,6 +4220,8 @@ Train* CmdBuildVirtualRailVehicle(EngineID eid, bool lax_engine_check, StringID train_part->SetVirtual(); } + v->UpdateViewport(true, false); + v->ConsistChanged(CCF_ARRANGE); CheckConsistencyOfArticulatedVehicle(v);