mirror of https://github.com/OpenTTD/OpenTTD
(svn r14103) -Fix [YAPP]: flooded trains didn't free their reservation
parent
aa80c3a96c
commit
bd6ef958e7
|
@ -889,7 +889,11 @@ static void FloodVehicle(Vehicle *v)
|
||||||
case VEH_TRAIN:
|
case VEH_TRAIN:
|
||||||
if (IsFrontEngine(v)) {
|
if (IsFrontEngine(v)) {
|
||||||
pass += 4; // driver
|
pass += 4; // driver
|
||||||
|
/* FreeTrainTrackReservation() calls GetVehicleTrackdir() that doesn't like crashed vehicles.
|
||||||
|
* In this case, v->direction matches v->u.rail.track, so we can do this (it wasn't crashed before) */
|
||||||
|
v->vehstatus &= ~VS_CRASHED;
|
||||||
FreeTrainTrackReservation(v);
|
FreeTrainTrackReservation(v);
|
||||||
|
v->vehstatus |= VS_CRASHED;
|
||||||
}
|
}
|
||||||
v->u.rail.crash_anim_pos = 4000; // max 4440, disappear pretty fast
|
v->u.rail.crash_anim_pos = 4000; // max 4440, disappear pretty fast
|
||||||
InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
|
InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
|
||||||
|
|
Loading…
Reference in New Issue