Fix fbbbc6e193: Assumption that Station::xy is a station tile

This commit is contained in:
Jonathan G Rennison
2019-09-21 11:39:42 +01:00
parent e0b33324a5
commit fc5df15b77

View File

@@ -1004,8 +1004,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
default: NOT_REACHED();
}
if (st->facilities & facil) {
StationID st_index = GetStationIndex(st->xy);
order.MakeGoToStation(st_index);
order.MakeGoToStation(st->index);
if (_ctrl_pressed) order.SetLoadType(OLF_FULL_LOAD_ANY);
if ((_settings_client.gui.new_nonstop || _settings_game.order.nonstop_only) && v->IsGroundVehicle()) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
order.SetStopLocation(v->type == VEH_TRAIN ? (OrderStopLocation)(_settings_client.gui.stop_location) : OSL_PLATFORM_FAR_END);