(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.
replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
frosch 16 years ago
parent cccd1a8739
commit 2bf182fb36

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