mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-09 16:09:15 +00:00
Several months worth of updates. --------- Co-authored-by: A miscellaneous Fern <80640114+FernandoJ8@users.noreply.github.com> Co-authored-by: Pepsilawn <reisenrui@gmail.com> Co-authored-by: Ray <64306407+OneAsianTortoise@users.noreply.github.com> Co-authored-by: Cure221 <106662180+Cure221@users.noreply.github.com>
18 lines
642 B
Plaintext
18 lines
642 B
Plaintext
GLOBAL_LIST_INIT(lazy_templates, generate_lazy_template_map())
|
|
|
|
/**
|
|
* Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance.
|
|
*
|
|
* Screams if more than one key exists, loudly.
|
|
*/
|
|
/proc/generate_lazy_template_map()
|
|
. = list()
|
|
for(var/datum/lazy_template/template as anything in subtypesof(/datum/lazy_template))
|
|
var/key = initial(template.key)
|
|
if(!key) // some subtypes like basketball and deathmatch have a base datum with no key
|
|
continue
|
|
if(key in .)
|
|
stack_trace("Found multiple lazy templates with the same key! '[key]'")
|
|
.[key] = new template
|
|
return .
|