diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index f8ac8d0176f..85221f5cf3c 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -1,5 +1,3 @@ -#define TRANSITIONEDGE 7 //Distance from edge to move to another z-level - //Object specific defines #define CANDLE_LUM 3 //For how bright candles are @@ -288,4 +286,4 @@ #define SHELTER_DEPLOY_ALLOWED "allowed" #define SHELTER_DEPLOY_BAD_TURFS "bad turfs" #define SHELTER_DEPLOY_BAD_AREA "bad area" -#define SHELTER_DEPLOY_ANCHORED_OBJECTS "anchored objects" \ No newline at end of file +#define SHELTER_DEPLOY_ANCHORED_OBJECTS "anchored objects" diff --git a/code/__DEFINES/zlevel.dm b/code/__DEFINES/zlevel.dm index e69de29bb2d..274fbb75f07 100644 --- a/code/__DEFINES/zlevel.dm +++ b/code/__DEFINES/zlevel.dm @@ -0,0 +1,12 @@ +#define Z_LEVEL_NORTH "1" +#define Z_LEVEL_SOUTH "2" +#define Z_LEVEL_EAST "4" +#define Z_LEVEL_WEST "8" + +#define TRANSITIONEDGE 7 //Distance from edge to move to another z-level + +// Defining these here so everything is consistent +#define TRANSITION_BORDER_NORTH (world.maxy - TRANSITIONEDGE - 1) +#define TRANSITION_BORDER_SOUTH TRANSITIONEDGE +#define TRANSITION_BORDER_EAST (world.maxx - TRANSITIONEDGE - 1) +#define TRANSITION_BORDER_WEST TRANSITIONEDGE diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index fb10d23ae9c..c8c454383ea 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -213,21 +213,21 @@ /turf/space/proc/set_transition_north(dest_z) destination_x = x - destination_y = TRANSITIONEDGE + 2 + destination_y = TRANSITION_BORDER_SOUTH + 1 destination_z = dest_z /turf/space/proc/set_transition_south(dest_z) destination_x = x - destination_y = world.maxy - TRANSITIONEDGE - 2 + destination_y = TRANSITION_BORDER_NORTH - 1 destination_z = dest_z /turf/space/proc/set_transition_east(dest_z) - destination_x = TRANSITIONEDGE + 2 + destination_x = TRANSITION_BORDER_WEST + 1 destination_y = y destination_z = dest_z /turf/space/proc/set_transition_west(dest_z) - destination_x = world.maxx - TRANSITIONEDGE - 2 + destination_x = TRANSITION_BORDER_EAST - 1 destination_y = y destination_z = dest_z diff --git a/code/modules/space_management/space_level.dm b/code/modules/space_management/space_level.dm index 02c16552c12..dc598ccab42 100644 --- a/code/modules/space_management/space_level.dm +++ b/code/modules/space_management/space_level.dm @@ -39,57 +39,57 @@ /datum/space_level/proc/build_space_destination_arrays() // We skip `add_to_transit` here because we want to skip the checks in order to save time // Bottom border - for(var/turf/space/S in block(locate(1,1,zpos),locate(world.maxx,TRANSITIONEDGE+1,zpos))) + for(var/turf/space/S in block(locate(1,1,zpos),locate(world.maxx,TRANSITION_BORDER_SOUTH,zpos))) transit_south |= S // Top border - for(var/turf/space/S in block(locate(1,world.maxy,zpos),locate(world.maxx,world.maxy - TRANSITIONEDGE - 1,zpos))) + for(var/turf/space/S in block(locate(1,world.maxy,zpos),locate(world.maxx,TRANSITION_BORDER_NORTH,zpos))) transit_north |= S // Left border - for(var/turf/space/S in block(locate(1,TRANSITIONEDGE+1,zpos),locate(TRANSITIONEDGE+1,world.maxy - TRANSITIONEDGE - 2,zpos))) + for(var/turf/space/S in block(locate(1,TRANSITION_BORDER_SOUTH + 1,zpos),locate(TRANSITION_BORDER_WEST,TRANSITION_BORDER_NORTH - 1,zpos))) transit_west |= S // Right border - for(var/turf/space/S in block(locate(world.maxx - TRANSITIONEDGE - 1,TRANSITIONEDGE+1,zpos),locate(world.maxx,world.maxy - TRANSITIONEDGE - 2,zpos))) + for(var/turf/space/S in block(locate(TRANSITION_BORDER_EAST,TRANSITION_BORDER_SOUTH + 1,zpos),locate(world.maxx,TRANSITION_BORDER_NORTH - 1,zpos))) transit_east |= S /datum/space_level/proc/add_to_transit(turf/space/S) - if(S.y <= TRANSITIONEDGE) + if(S.y <= TRANSITION_BORDER_SOUTH) transit_south |= S return // Top border - if(S.y >= (world.maxy - TRANSITIONEDGE - 1)) + if(S.y >= TRANSITION_BORDER_NORTH) transit_north |= S return // Left border - if(S.x <= TRANSITIONEDGE) + if(S.x <= TRANSITION_BORDER_WEST) transit_west |= S return // Right border - if(S.x >= (world.maxx - TRANSITIONEDGE - 1)) + if(S.x >= TRANSITION_BORDER_EAST) transit_east |= S /datum/space_level/proc/remove_from_transit(turf/space/S) - if(S.y <= TRANSITIONEDGE) + if(S.y <= TRANSITION_BORDER_SOUTH) transit_south -= S return // Top border - if(S.y >= (world.maxy - TRANSITIONEDGE - 1)) + if(S.y >= TRANSITION_BORDER_NORTH) transit_north -= S return // Left border - if(S.x <= TRANSITIONEDGE) + if(S.x <= TRANSITION_BORDER_WEST) transit_west -= S return // Right border - if(S.x >= (world.maxx - TRANSITIONEDGE - 1)) + if(S.x >= TRANSITION_BORDER_EAST) transit_east -= S /datum/space_level/proc/apply_transition(turf/space/S) @@ -101,16 +101,16 @@ if(SELFLOOPING,CROSSLINKED) var/datum/space_level/E = get_connection() if(S in transit_north) - E = get_connection("[NORTH]") + E = get_connection(Z_LEVEL_NORTH) S.set_transition_north(E.zpos) if(S in transit_south) - E = get_connection("[SOUTH]") + E = get_connection(Z_LEVEL_SOUTH) S.set_transition_south(E.zpos) if(S in transit_east) - E = get_connection("[EAST]") + E = get_connection(Z_LEVEL_EAST) S.set_transition_east(E.zpos) if(S in transit_west) - E = get_connection("[WEST]") + E = get_connection(Z_LEVEL_WEST) S.set_transition_west(E.zpos) diff --git a/code/modules/space_management/space_transition.dm b/code/modules/space_management/space_transition.dm index b7691ce6601..f432d9733a5 100644 --- a/code/modules/space_management/space_transition.dm +++ b/code/modules/space_management/space_transition.dm @@ -1,9 +1,5 @@ //This is realisation of the working torus-looping randomized-per-round space map, this kills the cube -#define Z_LEVEL_NORTH "1" -#define Z_LEVEL_SOUTH "2" -#define Z_LEVEL_EAST "4" -#define Z_LEVEL_WEST "8" /proc/get_opposite_direction(direction) switch(direction) @@ -430,9 +426,3 @@ else our_spot = our_spot.ChangeTurf(/turf/simulated/floor/fakespace) our_spot.desc = grid_desc - - -#undef Z_LEVEL_NORTH -#undef Z_LEVEL_SOUTH -#undef Z_LEVEL_EAST -#undef Z_LEVEL_WEST