If aircraft next order is for same station when leaving, do not leave
Just start loading again without moving instead
This commit is contained in:
@@ -2190,7 +2190,23 @@ static bool AircraftEventHandler(Aircraft *v, int loop)
|
|||||||
ProcessOrders(v);
|
ProcessOrders(v);
|
||||||
v->HandleLoading(loop != 0);
|
v->HandleLoading(loop != 0);
|
||||||
|
|
||||||
if (v->current_order.IsType(OT_LOADING) || v->current_order.IsType(OT_LEAVESTATION)) return true;
|
if (v->current_order.IsType(OT_LOADING)) return true;
|
||||||
|
|
||||||
|
if (v->current_order.IsType(OT_LEAVESTATION)) {
|
||||||
|
StationID station_id = v->current_order.GetDestination();
|
||||||
|
v->current_order.Free();
|
||||||
|
|
||||||
|
ProcessOrders(v);
|
||||||
|
|
||||||
|
if (v->current_order.IsType(OT_GOTO_STATION) && v->current_order.GetDestination() == station_id &&
|
||||||
|
v->targetairport == station_id && IsAirportTile(v->tile) && GetStationIndex(v->tile) == station_id) {
|
||||||
|
AircraftEntersTerminal(v);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
v->PlayLeaveStationSound();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (v->state >= ENDTAKEOFF && v->state <= HELIENDLANDING) {
|
if (v->state >= ENDTAKEOFF && v->state <= HELIENDLANDING) {
|
||||||
/* If we are flying, unconditionally clear the 'dest too far' state. */
|
/* If we are flying, unconditionally clear the 'dest too far' state. */
|
||||||
|
@@ -3538,7 +3538,7 @@ void Vehicle::HandleLoading(bool mode)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->type != VEH_TRAIN && this->type != VEH_SHIP) this->PlayLeaveStationSound();
|
if (this->type != VEH_TRAIN && this->type != VEH_SHIP && this->type != VEH_AIRCRAFT) this->PlayLeaveStationSound();
|
||||||
|
|
||||||
this->LeaveStation();
|
this->LeaveStation();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user