(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.
pull/155/head
frosch 16 years ago
parent 0f56f52080
commit 99969d533e

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

Loading…
Cancel
Save