mirror of https://github.com/OpenTTD/OpenTTD
(svn r5854) -Fix: [elrails] now electric engines are stopped if they enter a non-electrified depot even if they would have left right away if the depot had catenary
this solves the issue where electric engines in a certain situation could leave non-electrified depots, turn around and enter all the timerelease/0.5
parent
466452c351
commit
de4a96fd7a
|
@ -2079,6 +2079,13 @@ static bool CheckTrainStayInDepot(Vehicle *v)
|
||||||
if (u->u.rail.track != 0x80 || u->tile != v->tile) return false;
|
if (u->u.rail.track != 0x80 || u->tile != v->tile) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the train got no power, then keep it in the depot
|
||||||
|
if (v->u.rail.cached_power == 0) {
|
||||||
|
v->vehstatus |= VS_STOPPED;
|
||||||
|
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (v->u.rail.force_proceed == 0) {
|
if (v->u.rail.force_proceed == 0) {
|
||||||
if (++v->load_unload_time_rem < 37) {
|
if (++v->load_unload_time_rem < 37) {
|
||||||
InvalidateWindowClasses(WC_TRAINS_LIST);
|
InvalidateWindowClasses(WC_TRAINS_LIST);
|
||||||
|
|
Loading…
Reference in New Issue