|
@@ -9,24 +9,25 @@
|
|
|
|
|
|
#include "../stdafx.h"
|
|
|
|
|
|
#include "saveload.h"
|
|
|
#include "compat/station_sl_compat.h"
|
|
|
|
|
|
#include "../station_base.h"
|
|
|
#include "../waypoint_base.h"
|
|
|
#include "../roadstop_base.h"
|
|
|
#include "../vehicle_base.h"
|
|
|
#include "../newgrf_station.h"
|
|
|
#include "../newgrf_roadstop.h"
|
|
|
#include "../timer/timer_game_calendar.h"
|
|
|
|
|
|
#include "table/strings.h"
|
|
|
|
|
|
#include "../safeguards.h"
|
|
|
|
|
|
/**
|
|
|
* Update the buoy orders to be waypoint orders.
|
|
|
* @param o the order 'list' to check.
|
|
|
*/
|
|
|
static void UpdateWaypointOrder(Order *o)
|
|
|
{
|
|
|
if (!o->IsType(OT_GOTO_STATION)) return;
|
|
@@ -58,25 +59,25 @@ void MoveBuoysToWaypoints()
|
|
|
UpdateWaypointOrder(&v->current_order);
|
|
|
}
|
|
|
|
|
|
/* Now make the stations waypoints */
|
|
|
for (Station *st : Station::Iterate()) {
|
|
|
if ((st->had_vehicle_of_type & HVOT_WAYPOINT) == 0) continue;
|
|
|
|
|
|
StationID index = st->index;
|
|
|
TileIndex xy = st->xy;
|
|
|
Town *town = st->town;
|
|
|
StringID string_id = st->string_id;
|
|
|
std::string name = st->name;
|
|
|
Date build_date = st->build_date;
|
|
|
TimerGameCalendar::Date build_date = st->build_date;
|
|
|
/* TTDPatch could use "buoys with rail station" for rail waypoints */
|
|
|
bool train = st->train_station.tile != INVALID_TILE;
|
|
|
TileArea train_st = st->train_station;
|
|
|
|
|
|
/* Delete the station, so we can make it a real waypoint. */
|
|
|
delete st;
|
|
|
|
|
|
/* Stations and waypoints are in the same pool, so if a station
|
|
|
* is deleted there must be place for a Waypoint. */
|
|
|
assert(Waypoint::CanAllocateItem());
|
|
|
Waypoint *wp = new (index) Waypoint(xy);
|
|
|
wp->town = town;
|