mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-27 07:08:22 +01:00
Merge pull request #7308 from VOREStation/vplk-fix-multiz
Fix sector initialization overflow crash.
This commit is contained in:
@@ -71,8 +71,6 @@ SUBSYSTEM_DEF(skybox)
|
||||
return skybox_cache["[z]"]
|
||||
|
||||
/datum/controller/subsystem/skybox/proc/generate_skybox(z)
|
||||
to_world("generating skybox for z[z]")
|
||||
|
||||
var/datum/skybox_settings/settings = global.using_map.get_skybox_datum(z)
|
||||
|
||||
var/image/res = image(settings.icon)
|
||||
@@ -91,12 +89,10 @@ SUBSYSTEM_DEF(skybox)
|
||||
if(global.using_map.use_overmap && settings.use_overmap_details)
|
||||
var/obj/effect/overmap/visitable/O = get_overmap_sector(z)
|
||||
if(istype(O))
|
||||
to_world("found sector [O] \ref[O] for z[z]")
|
||||
var/image/overmap = image(settings.icon)
|
||||
overmap.overlays += O.generate_skybox()
|
||||
for(var/obj/effect/overmap/visitable/other in O.loc)
|
||||
if(other != O)
|
||||
to_world("found secondary sector [other] \ref[other]")
|
||||
overmap.overlays += other.get_skybox_representation()
|
||||
overmap.appearance_flags = RESET_COLOR
|
||||
res.overlays += overmap
|
||||
@@ -121,7 +117,7 @@ SUBSYSTEM_DEF(skybox)
|
||||
var/icon_state = "dyable"
|
||||
var/color
|
||||
var/random_color = FALSE
|
||||
|
||||
|
||||
var/use_stars = TRUE
|
||||
var/star_icon = 'icons/skybox/skybox.dmi'
|
||||
var/star_state = "stars"
|
||||
|
||||
@@ -37,8 +37,6 @@ var/list/z_levels = list()// Each bit re... haha just kidding this is a list of
|
||||
return HasBelow(turf.z) ? get_step(turf, DOWN) : null
|
||||
|
||||
/proc/GetConnectedZlevels(z)
|
||||
if(z in using_map.map_levels)
|
||||
return using_map.get_map_levels(z, FALSE) // Connected z levels aren't necessarily attached by multi-z, using_map shound know the details
|
||||
. = list(z)
|
||||
for(var/level = z, HasBelow(level), level--)
|
||||
. |= level-1
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
name = "map object"
|
||||
scannable = TRUE
|
||||
|
||||
var/list/map_z = null
|
||||
var/list/map_z = list()
|
||||
var/list/extra_z_levels //if you need to manually insist that these z-levels are part of this sector, for things like edge-of-map step trigger transitions rather than multi-z complexes
|
||||
|
||||
var/list/initial_generic_waypoints //store landmark_tag of landmarks that should be added to the actual lists below on init.
|
||||
@@ -30,8 +30,7 @@
|
||||
if(. == INITIALIZE_HINT_QDEL)
|
||||
return
|
||||
|
||||
if(!map_z) // If map_z is already defined, we don't need to find where we are
|
||||
find_z_levels() // This populates map_z and assigns z levels to the ship.
|
||||
find_z_levels() // This populates map_z and assigns z levels to the ship.
|
||||
register_z_levels() // This makes external calls to update global z level information.
|
||||
|
||||
if(!global.using_map.overmap_z)
|
||||
@@ -59,7 +58,8 @@
|
||||
. += A
|
||||
|
||||
/obj/effect/overmap/visitable/proc/find_z_levels()
|
||||
map_z = GetConnectedZlevels(z)
|
||||
if(!LAZYLEN(map_z)) // If map_z is already populated use it as-is, otherwise start with connected z-levels.
|
||||
map_z = GetConnectedZlevels(z)
|
||||
if(LAZYLEN(extra_z_levels))
|
||||
map_z |= extra_z_levels
|
||||
|
||||
|
||||
Reference in New Issue
Block a user