mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 08:37:43 +01:00
Refactors Holodeck to Use Map Templates, Again! Black Magic OOM Crashing No Longer Included (#55645)
Refactors the holodeck to use map templates instead of copy_contents_to, which every maintainer seems to have complaints about. Fixes #41485 because the matches become part of the spawned list created by ssatoms Fixes #54789 because the holodeck area no longer has the NO_TELEPORT flag Fixes #55676 because the map templates cant be changed midround unlike the program copies in the centcom z level Fixes #49318 because the holodeck no longer creates new areas like the original did This pr also changes initTemplateBounds to be a /datum/map_template proc instead of a parsed_map proc. This was mainly so I wouldn't have to duplicate vars between map_template and parsed_map. It's also nice because there's no longer a parsed_map proc inside the map_template file, especially when it didn't need to be a parsed_map proc. The holodeck sims wont take up space in the centcom z level any more (which allows for more possible programs in the future), and map templates are more heavily tested. This is also a chance to future proof the holodeck against bugs. Holodeck also seems more responsive. This should allow for a second custom holodeck in some future ruin as well, although that of course will not be in play for the near future because of the offstation content ban. Also I documented the fuck out of the holodeck
This commit is contained in:
@@ -22,6 +22,9 @@
|
||||
/// Offset bounds. Same as parsed_bounds until load().
|
||||
var/list/bounds
|
||||
|
||||
///any turf in this list is skipped inside of build_coordinate
|
||||
var/list/turf_blacklist = list()
|
||||
|
||||
// raw strings used to represent regexes more accurately
|
||||
// '' used to avoid confusing syntax highlighting
|
||||
var/static/regex/dmmRegex = new(@'"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}', "g")
|
||||
@@ -304,6 +307,10 @@
|
||||
//Instanciation
|
||||
////////////////
|
||||
|
||||
for (var/turf_in_blacklist in turf_blacklist)
|
||||
if (crds == turf_in_blacklist) //if the given turf is blacklisted, dont do anything with it
|
||||
return
|
||||
|
||||
//The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile
|
||||
//first instance the /area and remove it from the members list
|
||||
index = members.len
|
||||
@@ -474,4 +481,9 @@
|
||||
|
||||
/datum/parsed_map/Destroy()
|
||||
..()
|
||||
turf_blacklist.Cut()
|
||||
parsed_bounds.Cut()
|
||||
bounds.Cut()
|
||||
grid_models.Cut()
|
||||
gridSets.Cut()
|
||||
return QDEL_HINT_HARDDEL_NOW
|
||||
|
||||
Reference in New Issue
Block a user