From 2bf182fb366e3feb5cdc917ba8c62fb5143e6c6b Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 21 Sep 2008 14:03:47 +0000 Subject: (svn r14369) -Fix: Enforce non-front engines to be stopped. This could be caused by old savegames resp. their conversion, and causes trouble for e.g. autoreplace. --- src/vehicle.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 193562abf..1e6ffb374 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -264,6 +264,11 @@ void AfterLoadVehicles(bool clear_te_id) } } + /* Stop non-front engines */ + FOR_ALL_VEHICLES(v) { + if (v->type == VEH_TRAIN && IsTrainEngine(v) && !IsFrontEngine(v)) v->vehstatus |= VS_STOPPED; + } + FOR_ALL_VEHICLES(v) { switch (v->type) { case VEH_ROAD: @@ -1110,6 +1115,7 @@ CommandCost CmdStartStopVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 Vehicle *v = GetVehicle(p1); if (!CheckOwnership(v->owner)) return CMD_ERROR; + if (!v->IsPrimaryVehicle()) return CMD_ERROR; switch (v->type) { case VEH_TRAIN: -- cgit v1.2.3-70-g09d2