mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] Simultaneous map definitions (#10295)
Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
committed by
GitHub
parent
79d8693a6f
commit
651c8bc1af
@@ -1,6 +1,7 @@
|
||||
/datum/map_template
|
||||
var/name = "Default Template Name"
|
||||
var/desc = "Some text should go here. Maybe."
|
||||
var/name_alias // Override to what this map gets registered as in map_templates_loaded
|
||||
var/template_group = null // If this is set, no more than one template in the same group will be spawned, per submap seeding.
|
||||
var/width = 0
|
||||
var/height = 0
|
||||
@@ -45,7 +46,7 @@
|
||||
var/list/obj/structure/cable/cables = list()
|
||||
var/list/obj/machinery/atmospherics/atmos_machines = list()
|
||||
var/list/turf/turfs = block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]),
|
||||
locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]))
|
||||
locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]))
|
||||
for(var/turf/B as anything in turfs)
|
||||
areas |= B.loc
|
||||
for(var/A in B)
|
||||
@@ -91,6 +92,7 @@
|
||||
x = round((world.maxx - width)/2)
|
||||
y = round((world.maxy - height)/2)
|
||||
|
||||
on_map_preload(world.maxz + 1) //VOREStation Edit
|
||||
var/datum/bapi_parsed_map/map = load_map_bapi(mappath, x, y, no_changeturf = TRUE)
|
||||
var/list/bounds = map.bounds
|
||||
if(!bounds)
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/// An asslist of name=z for map_templates that have been loaded
|
||||
GLOBAL_LIST_EMPTY(map_templates_loaded)
|
||||
|
||||
/// Registers the map into GLOB.map_templates_loaded
|
||||
/datum/map_template/proc/on_map_preload(z)
|
||||
if(name_alias)
|
||||
GLOB.map_templates_loaded[name_alias] = z
|
||||
else
|
||||
GLOB.map_templates_loaded[name] = z
|
||||
|
||||
/datum/map_template/proc/on_map_loaded(z)
|
||||
//We missed air init!
|
||||
if(SSair.subsystem_initialized)
|
||||
|
||||
Reference in New Issue
Block a user