TBTR: Fix attempting to get sprite for new virtual engine before marking as virtual

This commit is contained in:
Jonathan G Rennison 2017-09-23 11:39:59 +01:00
parent 753fc2ab67
commit 40c99956ed

View File

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