mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 08:29:57 +01:00
Ports the TG globals controller and converts globals. (#18057)
* SDQL2 update * fix that verb * cl * fix that * toworld * this is pointless * update info * siiiiick.. * vv edit update * fix that * fix editing vars * fix VV * Port the /TG/ globals controller. * part 1 * part 2 * oops * part 3 * Hollow Purple * sadas * bsbsdb * muda na agaki ta * ids 1-15 * 16-31 * 41-75 * bring me back to how things used to be before i lost it all * the strength of mayhem * final touches * cl * protect some vars * update sdql2 to use glob * stuff? * forgot that is not defined there * whoops * observ * but it never gets better * a --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// If you add a more comprehensive system, just untick this file.
|
||||
// Because this shit before was, for some reason, a bitfield.
|
||||
var/global/list/z_levels = list()
|
||||
GLOBAL_LIST_EMPTY(z_levels)
|
||||
var/list/list/connected_z_cache = list()
|
||||
|
||||
// If the height is more than 1, we mark all contained levels as connected.
|
||||
@@ -11,23 +11,23 @@ var/list/list/connected_z_cache = list()
|
||||
if(_height)
|
||||
height = _height
|
||||
for(var/i = (loc.z - height + 1) to (loc.z-1))
|
||||
if (z_levels.len <i)
|
||||
z_levels.len = i
|
||||
z_levels[i] = TRUE
|
||||
if (GLOB.z_levels.len <i)
|
||||
GLOB.z_levels.len = i
|
||||
GLOB.z_levels[i] = TRUE
|
||||
|
||||
/obj/effect/landmark/map_data/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
/proc/HasAbove(var/z)
|
||||
if(z >= world.maxz || z < 1 || z > z_levels.len)
|
||||
if(z >= world.maxz || z < 1 || z > GLOB.z_levels.len)
|
||||
return 0
|
||||
return z_levels[z]
|
||||
return GLOB.z_levels[z]
|
||||
|
||||
/proc/HasBelow(var/z)
|
||||
if(z > world.maxz || z < 2 || (z-1) > z_levels.len)
|
||||
if(z > world.maxz || z < 2 || (z-1) > GLOB.z_levels.len)
|
||||
return 0
|
||||
return z_levels[z-1]
|
||||
return GLOB.z_levels[z-1]
|
||||
|
||||
// Thankfully, no bitwise magic is needed here.
|
||||
/proc/GetAbove(var/atom/atom)
|
||||
|
||||
@@ -796,7 +796,7 @@
|
||||
forceMove(T)
|
||||
tile_shifted = TRUE
|
||||
follow()
|
||||
moved_event.register(owner, src, PROC_REF(follow))
|
||||
GLOB.moved_event.register(owner, src, PROC_REF(follow))
|
||||
|
||||
/atom/movable/z_observer/proc/follow()
|
||||
|
||||
@@ -823,7 +823,7 @@
|
||||
qdel(src)
|
||||
|
||||
/atom/movable/z_observer/Destroy()
|
||||
moved_event.unregister(owner, src, PROC_REF(follow))
|
||||
GLOB.moved_event.unregister(owner, src, PROC_REF(follow))
|
||||
owner = null
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
normalize_dir()
|
||||
var/node1_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/direction in GLOB.cardinal)
|
||||
if(direction&initialize_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
@@ -199,7 +199,7 @@
|
||||
normalize_dir()
|
||||
var/node1_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/direction in GLOB.cardinal)
|
||||
if(direction&initialize_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
|
||||
var/obj/structure/stairs/staircase = locate() in target
|
||||
var/target_dir = get_dir(mover, target)
|
||||
if(!staircase && (target_dir != dir && target_dir != reverse_dir[dir]))
|
||||
if(!staircase && (target_dir != dir && target_dir != GLOB.reverse_dir[dir]))
|
||||
INVOKE_ASYNC(src, PROC_REF(mob_fall), mover)
|
||||
|
||||
return ..()
|
||||
@@ -390,7 +390,7 @@
|
||||
return TRUE
|
||||
if(mover.throwing)
|
||||
return TRUE
|
||||
if(get_dir(mover, target) == reverse_dir[dir])
|
||||
if(get_dir(mover, target) == GLOB.reverse_dir[dir])
|
||||
return FALSE
|
||||
if(height && (mover.dir == dir))
|
||||
return FALSE
|
||||
@@ -399,7 +399,7 @@
|
||||
/obj/structure/platform/CheckExit(var/atom/movable/O, var/turf/target)
|
||||
if(istype(O) && CanPass(O, target))
|
||||
return TRUE
|
||||
if(get_dir(O, target) == reverse_dir[dir])
|
||||
if(get_dir(O, target) == GLOB.reverse_dir[dir])
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -409,7 +409,7 @@
|
||||
/// If the user is on the same turf as the platform, we're trying to go past it, so we need to use reverse_dir.
|
||||
/// Otherwise, use our own turf.
|
||||
var/same_turf = get_turf(user) == get_turf(src)
|
||||
var/turf/next_turf = get_step(src, same_turf ? reverse_dir[dir] : 0)
|
||||
var/turf/next_turf = get_step(src, same_turf ? GLOB.reverse_dir[dir] : 0)
|
||||
if(istype(next_turf) && !next_turf.density && can_climb(user))
|
||||
var/climb_text = same_turf ? "over" : "down"
|
||||
LAZYADD(climbers, user)
|
||||
|
||||
Reference in New Issue
Block a user