|
@@ -8,12 +8,13 @@
|
|
|
*/
|
|
|
|
|
|
/** @file waypoint_cmd.cpp Command Handling for waypoints. */
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
#include "cmd_helper.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"
|
|
@@ -212,18 +213,18 @@ extern CommandCost CanExpandRailStation(
|
|
|
* @param text unused
|
|
|
* @return the cost of this operation or an error
|
|
|
*/
|
|
|
CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
|
|
{
|
|
|
/* Unpack parameters */
|
|
|
Axis axis = (Axis)GB(p1, 4, 1);
|
|
|
Axis axis = Extract<Axis, 4, 1>(p1);
|
|
|
byte width = GB(p1, 8, 8);
|
|
|
byte height = GB(p1, 16, 8);
|
|
|
bool adjacent = HasBit(p1, 24);
|
|
|
|
|
|
StationClassID spec_class = (StationClassID)GB(p2, 0, 8);
|
|
|
StationClassID spec_class = Extract<StationClassID, 0, 8>(p2);
|
|
|
byte spec_index = GB(p2, 8, 8);
|
|
|
StationID station_to_join = GB(p2, 16, 16);
|
|
|
|
|
|
/* Check if the given station class is valid */
|
|
|
if (spec_class != STAT_CLASS_WAYP) return CMD_ERROR;
|
|
|
if (spec_index >= GetNumCustomStations(spec_class)) return CMD_ERROR;
|