(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.
This commit is contained in:
frosch 2008-09-21 14:03:47 +00:00
parent cccd1a8739
commit 2bf182fb36
1 changed files with 6 additions and 0 deletions

View File

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