waypoint.c
changeset 3977 edb5b94e2094
parent 3933 a5f08e17f4a0
child 4000 bab1ebc37da0
equal deleted inserted replaced
3976:b52d2c1acc5c 3977:edb5b94e2094
     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"
       
    13 #include "saveload.h"
    12 #include "saveload.h"
    14 #include "station.h"
    13 #include "station.h"
    15 #include "tile.h"
    14 #include "tile.h"
    16 #include "town.h"
    15 #include "town.h"
    17 #include "waypoint.h"
    16 #include "waypoint.h"
   199 	tileh = GetTileSlope(tile, NULL);
   198 	tileh = GetTileSlope(tile, NULL);
   200 	if (tileh != SLOPE_FLAT) {
   199 	if (tileh != SLOPE_FLAT) {
   201 		if (!_patches.build_on_slopes || IsSteepSlope(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))
   200 		if (!_patches.build_on_slopes || IsSteepSlope(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))
   202 			return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
   201 			return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
   203 	}
   202 	}
   204 
       
   205 	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
       
   206 
   203 
   207 	/* Check if there is an already existing, deleted, waypoint close to us that we can reuse. */
   204 	/* Check if there is an already existing, deleted, waypoint close to us that we can reuse. */
   208 	wp = FindDeletedWaypointCloseTo(tile);
   205 	wp = FindDeletedWaypointCloseTo(tile);
   209 	if (wp == NULL) {
   206 	if (wp == NULL) {
   210 		wp = AllocateWaypoint();
   207 		wp = AllocateWaypoint();