diff options
author | rubidium <rubidium@openttd.org> | 2010-05-23 22:14:22 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-05-23 22:14:22 +0000 |
commit | 4092471a98f8a3fdfb75b2ff946535349536f4e8 (patch) | |
tree | 7a4f3583a0b1c733d6346f16af5210f301d10b72 /src | |
parent | 5ba088982d3b2ebe28f57317bc75a455dd4e32a3 (diff) | |
download | openttd-4092471a98f8a3fdfb75b2ff946535349536f4e8.tar.xz |
(svn r19892) -Fix [FS#3856] (r19792): crash when trying to reserve 'in depot' track on clearing a crashed train
Diffstat (limited to 'src')
-rw-r--r-- | src/train_cmd.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index fc8ec0253..2dfca725c 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -3455,11 +3455,12 @@ static Vehicle *CollectTrackbitsFromCrashedVehiclesEnum(Vehicle *v, void *data) TrackBits *trackbits = (TrackBits *)data; if (v->type == VEH_TRAIN && (v->vehstatus & VS_CRASHED) != 0) { - if (Train::From(v)->track == TRACK_BIT_WORMHOLE) { + TrackBits train_tbits = Train::From(v)->track; + if (train_tbits == TRACK_BIT_WORMHOLE) { /* Vehicle is inside a wormhole, v->track contains no useful value then. */ *trackbits |= DiagDirToDiagTrackBits(GetTunnelBridgeDirection(v->tile)); - } else { - *trackbits |= Train::From(v)->track; + } else if (train_tbits != TRACK_BIT_DEPOT) { + *trackbits |= train_tbits; } } |