[MIRROR] Adds optional automatic ceiling generation for map templates and gives bluespace shelters ceilings [MDB IGNORE] (#12229)

* Adds optional automatic ceiling generation for map templates and gives bluespace shelters ceilings (#65582)

* Gives bluespace shelters roofs

* Adds automatic ceiling generation for templates

* baseturf_bottom makes this a lot simpler

* Adds optional automatic ceiling generation for map templates and gives bluespace shelters ceilings

Co-authored-by: GoblinBackwards <22856555+GoblinBackwards@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-03-22 21:05:17 +00:00
committed by GitHub
co-authored by GoblinBackwards
parent 1efe48e827
commit 0299f5a734
2 changed files with 20 additions and 0 deletions
+17
View File
@@ -21,6 +21,11 @@
var/list/created_atoms = list()
//make sure this list is accounted for/cleared if you request it from ssatoms!
// vars for automatic ceiling generation
var/has_ceiling = FALSE
var/turf/ceiling_turf = /turf/open/floor/plating
var/list/ceiling_baseturfs = list()
/datum/map_template/New(path = null, rename = null, cache = FALSE)
if(path)
mappath = path
@@ -28,6 +33,7 @@
preload_size(mappath, cache)
if(rename)
name = rename
ceiling_baseturfs.Insert(1, /turf/baseturf_bottom)
/datum/map_template/proc/preload_size(path, cache = FALSE)
var/datum/parsed_map/parsed = new(file(path))
@@ -176,9 +182,20 @@
//initialize things that are normally initialized after map load
initTemplateBounds(bounds)
if(has_ceiling)
var/affected_turfs = get_affected_turfs(T, FALSE)
generate_ceiling(affected_turfs)
log_game("[name] loaded at [T.x],[T.y],[T.z]")
return bounds
/datum/map_template/proc/generate_ceiling(affected_turfs)
for (var/turf/turf in affected_turfs)
var/turf/ceiling = get_step_multiz(turf, UP)
if (ceiling)
if (istype(ceiling, /turf/open/openspace) || istype(ceiling, /turf/open/space/openspace))
ceiling.ChangeTurf(ceiling_turf, ceiling_baseturfs, CHANGETURF_INHERIT_AIR)
/datum/map_template/proc/post_load()
return