|
@@ -10,25 +10,25 @@
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
#include "command_func.h"
|
|
|
#include "landscape.h"
|
|
|
#include "bridge_map.h"
|
|
|
#include "town.h"
|
|
|
#include "waypoint_base.h"
|
|
|
#include "pathfinder/yapf/yapf_cache.h"
|
|
|
#include "strings_func.h"
|
|
|
#include "viewport_func.h"
|
|
|
#include "viewport_kdtree.h"
|
|
|
#include "window_func.h"
|
|
|
#include "date_func.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
#include "vehicle_func.h"
|
|
|
#include "string_func.h"
|
|
|
#include "company_func.h"
|
|
|
#include "newgrf_station.h"
|
|
|
#include "company_base.h"
|
|
|
#include "water.h"
|
|
|
#include "company_gui.h"
|
|
|
#include "waypoint_cmd.h"
|
|
|
#include "landscape_cmd.h"
|
|
|
|
|
|
#include "table/strings.h"
|
|
|
|
|
@@ -239,25 +239,25 @@ CommandCost CmdBuildRailWaypoint(DoComma
|
|
|
if (wp == nullptr) {
|
|
|
wp = new Waypoint(start_tile);
|
|
|
} else if (!wp->IsInUse()) {
|
|
|
/* Move existing (recently deleted) waypoint to the new location */
|
|
|
wp->xy = start_tile;
|
|
|
}
|
|
|
wp->owner = GetTileOwner(start_tile);
|
|
|
|
|
|
wp->rect.BeforeAddRect(start_tile, width, height, StationRect::ADD_TRY);
|
|
|
|
|
|
wp->delete_ctr = 0;
|
|
|
wp->facilities |= FACIL_TRAIN;
|
|
|
wp->build_date = _date;
|
|
|
wp->build_date = TimerGameCalendar::date;
|
|
|
wp->string_id = STR_SV_STNAME_WAYPOINT;
|
|
|
wp->train_station = new_location;
|
|
|
|
|
|
if (wp->town == nullptr) MakeDefaultName(wp);
|
|
|
|
|
|
wp->UpdateVirtCoord();
|
|
|
|
|
|
const StationSpec *spec = StationClass::Get(spec_class)->GetSpec(spec_index);
|
|
|
byte *layout_ptr = new byte[count];
|
|
|
if (spec == nullptr) {
|
|
|
/* The layout must be 0 for the 'normal' waypoints by design. */
|
|
|
memset(layout_ptr, 0, count);
|
|
@@ -320,25 +320,25 @@ CommandCost CmdBuildBuoy(DoCommandFlag f
|
|
|
} else {
|
|
|
/* Move existing (recently deleted) buoy to the new location */
|
|
|
wp->xy = tile;
|
|
|
InvalidateWindowData(WC_WAYPOINT_VIEW, wp->index);
|
|
|
}
|
|
|
wp->rect.BeforeAddTile(tile, StationRect::ADD_TRY);
|
|
|
|
|
|
wp->string_id = STR_SV_STNAME_BUOY;
|
|
|
|
|
|
wp->facilities |= FACIL_DOCK;
|
|
|
wp->owner = OWNER_NONE;
|
|
|
|
|
|
wp->build_date = _date;
|
|
|
wp->build_date = TimerGameCalendar::date;
|
|
|
|
|
|
if (wp->town == nullptr) MakeDefaultName(wp);
|
|
|
|
|
|
MakeBuoy(tile, wp->index, GetWaterClass(tile));
|
|
|
CheckForDockingTile(tile);
|
|
|
MarkTileDirtyByTile(tile);
|
|
|
|
|
|
wp->UpdateVirtCoord();
|
|
|
InvalidateWindowData(WC_WAYPOINT_VIEW, wp->index);
|
|
|
}
|
|
|
|
|
|
return cost;
|