waypoint.c
changeset 3933 231ae3c419f4
parent 3900 2c84ed52709d
child 3977 513433ebd092
equal deleted inserted replaced
3932:dfe10fa5ce4f 3933:231ae3c419f4
     7 #include "functions.h"
     7 #include "functions.h"
     8 #include "gfx.h"
     8 #include "gfx.h"
     9 #include "map.h"
     9 #include "map.h"
    10 #include "order.h"
    10 #include "order.h"
    11 #include "rail_map.h"
    11 #include "rail_map.h"
       
    12 #include "bridge_map.h"
    12 #include "saveload.h"
    13 #include "saveload.h"
    13 #include "station.h"
    14 #include "station.h"
    14 #include "tile.h"
    15 #include "tile.h"
    15 #include "town.h"
    16 #include "town.h"
    16 #include "waypoint.h"
    17 #include "waypoint.h"
   198 	tileh = GetTileSlope(tile, NULL);
   199 	tileh = GetTileSlope(tile, NULL);
   199 	if (tileh != SLOPE_FLAT) {
   200 	if (tileh != SLOPE_FLAT) {
   200 		if (!_patches.build_on_slopes || IsSteepSlope(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))
   201 		if (!_patches.build_on_slopes || IsSteepSlope(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))
   201 			return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
   202 			return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
   202 	}
   203 	}
       
   204 
       
   205 	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
   203 
   206 
   204 	/* Check if there is an already existing, deleted, waypoint close to us that we can reuse. */
   207 	/* Check if there is an already existing, deleted, waypoint close to us that we can reuse. */
   205 	wp = FindDeletedWaypointCloseTo(tile);
   208 	wp = FindDeletedWaypointCloseTo(tile);
   206 	if (wp == NULL) {
   209 	if (wp == NULL) {
   207 		wp = AllocateWaypoint();
   210 		wp = AllocateWaypoint();