changes:

Fixes a regression in GetAbove/GetBelow() that caused passing an atom that wasn't directly on the map to return a false negative.
Fixes runtime's broken Z1 MZ by moving it to Z2.
Fixes some outdated Z-level defines on Runtime.
Moves z_levels global to SSatlas for easier debugging.
Atlas will now list the size of the world in its MC entry.
Map diffs are fucked up because of the index shift, nothing on the maps themselves was actually changed beyond adding a blank Z at the bottom.

Fixes #4692.
This commit is contained in:
Lohikar
2018-06-26 23:16:23 +03:00
committed by Erki
parent faa639bdfa
commit b4fdd35a1e
9 changed files with 29 additions and 17 deletions
+3 -3
View File
@@ -450,10 +450,10 @@ Define for getting a bitfield of adjacent turfs that meet a condition.
// Z-controller stuff - see basic.dm to see why the fuck this is the way it is.
#define IS_VALID_ZINDEX(z) !((z) > world.maxz || z > 17 || z < 2)
#define IS_VALID_ZINDEX(z) !((z) > world.maxz || (z) > 17)
#define HAS_ABOVE(z) (IS_VALID_ZINDEX(z) && z_levels & (1 << (z - 1)))
#define HAS_BELOW(z) (IS_VALID_ZINDEX(z) && z_levels & (1 << (z - 2)))
#define HAS_ABOVE(z) (IS_VALID_ZINDEX(z) && SSatlas.z_levels & (1 << (z - 1)))
#define HAS_BELOW(z) (IS_VALID_ZINDEX(z) && (z) != 1 && SSatlas.z_levels & (1 << (z - 2)))
#define GET_ABOVE(A) (HAS_ABOVE(A:z) ? get_step(A, UP) : null)
#define GET_BELOW(A) (HAS_BELOW(A:z) ? get_step(A, DOWN) : null)
@@ -800,7 +800,6 @@
SearchVar(ntnet_card_uid)
SearchVar(ntnet_global)
SearchVar(ntnrc_uid)
SearchVar(z_levels)
SearchVar(BLOOD_VOLUME_SAFE)
SearchVar(BLOOD_VOLUME_OKAY)
SearchVar(BLOOD_VOLUME_BAD)
@@ -18,6 +18,10 @@ var/datum/controller/subsystem/atlas/SSatlas
var/list/spawn_locations = list()
var/list/connected_z_cache = list()
var/z_levels = 0 // Each bit represents a connection between adjacent levels. So the first bit means levels 1 and 2 are connected.
/datum/controller/subsystem/atlas/stat_entry()
..("W:{X:[world.maxx] Y:[world.maxy] Z:[world.maxz]} ZL:[z_levels]")
/datum/controller/subsystem/atlas/New()
NEW_SS_GLOBAL(SSatlas)
@@ -112,6 +116,7 @@ var/datum/controller/subsystem/atlas/SSatlas
/datum/controller/subsystem/atlas/proc/setup_multiz()
for (var/thing in height_markers)
var/obj/effect/landmark/map_data/marker = thing
log_debug("atlas: setting up Z marker on level [marker.z] with height [marker.height].")
marker.setup()
connected_z_cache.Cut()
+2 -2
View File
@@ -13,9 +13,9 @@
flags = SS_FIRE_IN_LOBBY
var/list/queued_turfs = list()
var/list/qt_idex = 1
var/qt_idex = 1
var/list/queued_overlays = list()
var/list/qo_idex = 1
var/qo_idex = 1
var/list/openspace_overlays = list()
var/list/openspace_turfs = list()
+10 -3
View File
@@ -1,6 +1,5 @@
// If you add a more comprehensive system, just untick this file.
// WARNING: Only works for up to 17 z-levels!
var/z_levels = 0 // Each bit represents a connection between adjacent levels. So the first bit means levels 1 and 2 are connected.
// If the height is more than 1, we mark all contained levels as connected.
/obj/effect/landmark/map_data/New()
@@ -10,7 +9,7 @@ var/z_levels = 0 // Each bit represents a connection between adjacent levels. S
ASSERT(height <= z)
// Due to the offsets of how connections are stored v.s. how z-levels are indexed, some magic number silliness happened.
for(var/i = (z - height) to (z - 2))
z_levels |= (1 << i)
SSatlas.z_levels |= (1 << i)
qdel(src)
/obj/effect/landmark/map_data/Destroy()
@@ -26,9 +25,13 @@ var/z_levels = 0 // Each bit represents a connection between adjacent levels. S
// Thankfully, no bitwise magic is needed here.
/proc/GetAbove(atom/A)
if (!A.z)
A = get_turf(A)
return A ? GET_ABOVE(A) : null
/proc/GetBelow(atom/A)
if (!A.z)
A = get_turf(A)
return A ? GET_BELOW(A) : null
/proc/GetConnectedZlevels(z)
@@ -57,7 +60,11 @@ var/z_levels = 0 // Each bit represents a connection between adjacent levels. S
return new_entry[zB]
/proc/get_zstep(ref, dir)
/proc/get_zstep(atom/ref, dir)
if (!isloc(ref))
CRASH("Expected atom.")
if (!ref.z)
ref = get_turf(ref)
switch (dir)
if (UP)
. = GET_ABOVE(ref)
+4
View File
@@ -0,0 +1,4 @@
author: Lohikar
delete-after: True
changes:
- bugfix: "RIG actuator Z-climbing now actually works. Probably."
+4 -4
View File
@@ -3,11 +3,11 @@
full_name = "Runtime Debugging Station"
path = "runtime"
station_levels = list(1)
station_levels = list(1, 2, 3)
admin_levels = list()
contact_levels = list(1)
player_levels = list(1)
accessible_z_levels = list()
contact_levels = list(1, 2, 3)
player_levels = list(1, 2, 3)
accessible_z_levels = list(1, 2, 3)
station_name = "NSS Runtime"
station_short = "Runtime"
-3
View File
@@ -1,8 +1,5 @@
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
"a" = (
/obj/effect/landmark/map_data{
height = 2
},
/turf/template_noop,
/area/template_noop)
"b" = (
+1 -1
View File
@@ -1,7 +1,7 @@
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
"a" = (
/obj/effect/landmark/map_data{
height = 2
height = 3
},
/turf/template_noop,
/area/template_noop)