mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 13:07:46 +01:00
Merge pull request #5516 from Crazylemon64/space_transition_runtime_fix
Fixes roundstart space transitions runtime
This commit is contained in:
@@ -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"
|
||||
#define SHELTER_DEPLOY_ANCHORED_OBJECTS "anchored objects"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user