mirror of https://github.com/OpenTTD/OpenTTD
(svn r9745) -Codechange [YAPF}: if destination is a waypoint then YAPF gets destination tile from that waypoint->xy instead of from v->dest_tile
parent
469c04478a
commit
027597f485
|
@ -86,14 +86,27 @@ protected:
|
||||||
public:
|
public:
|
||||||
void SetDestination(Vehicle* v)
|
void SetDestination(Vehicle* v)
|
||||||
{
|
{
|
||||||
if (v->current_order.type == OT_GOTO_STATION) {
|
switch (v->current_order.type) {
|
||||||
m_destTile = CalcStationCenterTile(v->current_order.dest);
|
case OT_GOTO_STATION:
|
||||||
m_dest_station_id = v->current_order.dest;
|
m_destTile = CalcStationCenterTile(v->current_order.dest);
|
||||||
m_destTrackdirs = INVALID_TRACKDIR_BIT;
|
m_dest_station_id = v->current_order.dest;
|
||||||
} else {
|
m_destTrackdirs = INVALID_TRACKDIR_BIT;
|
||||||
m_destTile = v->dest_tile;
|
break;
|
||||||
m_dest_station_id = INVALID_STATION;
|
|
||||||
m_destTrackdirs = (TrackdirBits)(GetTileTrackStatus(v->dest_tile, TRANSPORT_RAIL) & TRACKDIR_BIT_MASK);
|
case OT_GOTO_WAYPOINT: {
|
||||||
|
Waypoint *wp = GetWaypoint(v->current_order.dest);
|
||||||
|
if (wp == NULL) break;
|
||||||
|
m_destTile = wp->xy;
|
||||||
|
m_dest_station_id = INVALID_STATION;
|
||||||
|
m_destTrackdirs = TrackToTrackdirBits(AxisToTrack(GetWaypointAxis(wp->xy)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
m_destTile = v->dest_tile;
|
||||||
|
m_dest_station_id = INVALID_STATION;
|
||||||
|
m_destTrackdirs = (TrackdirBits)(GetTileTrackStatus(v->dest_tile, TRANSPORT_RAIL) & TRACKDIR_BIT_MASK);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
CYapfDestinationRailBase::SetDestination(v);
|
CYapfDestinationRailBase::SetDestination(v);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue