mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user