86 public: |
86 public: |
87 void SetDestination(Vehicle* v) |
87 void SetDestination(Vehicle* v) |
88 { |
88 { |
89 switch (v->current_order.GetType()) { |
89 switch (v->current_order.GetType()) { |
90 case OT_GOTO_STATION: |
90 case OT_GOTO_STATION: |
91 m_destTile = CalcStationCenterTile(v->current_order.dest); |
91 m_destTile = CalcStationCenterTile(v->current_order.GetDestination()); |
92 m_dest_station_id = v->current_order.dest; |
92 m_dest_station_id = v->current_order.GetDestination(); |
93 m_destTrackdirs = INVALID_TRACKDIR_BIT; |
93 m_destTrackdirs = INVALID_TRACKDIR_BIT; |
94 break; |
94 break; |
95 |
95 |
96 case OT_GOTO_WAYPOINT: { |
96 case OT_GOTO_WAYPOINT: { |
97 Waypoint *wp = GetWaypoint(v->current_order.dest); |
97 Waypoint *wp = GetWaypoint(v->current_order.GetDestination()); |
98 if (wp == NULL) { |
98 if (wp == NULL) { |
99 /* Invalid waypoint in orders! */ |
99 /* Invalid waypoint in orders! */ |
100 DEBUG(yapf, 0, "Invalid waypoint in orders == 0x%04X (train %d, player %d)", v->current_order.dest, v->unitnumber, (PlayerID)v->owner); |
100 DEBUG(yapf, 0, "Invalid waypoint in orders == 0x%04X (train %d, player %d)", v->current_order.GetDestination(), v->unitnumber, (PlayerID)v->owner); |
101 break; |
101 break; |
102 } |
102 } |
103 m_destTile = wp->xy; |
103 m_destTile = wp->xy; |
104 if (m_destTile != v->dest_tile) { |
104 if (m_destTile != v->dest_tile) { |
105 /* Something is wrong with orders! */ |
105 /* Something is wrong with orders! */ |