Files
Yogstation/code/modules/mapping/preloader.dm
ShizCalev cacec75e83 Move map errors to their own log file (#43376)
In interest of getting things fixed without having to constantly crawl
through game.log to find map issues, moved them to their own log file.
2019-03-30 21:54:27 +01:00

38 lines
1.1 KiB
Plaintext

// global datum that will preload variables on atoms instanciation
GLOBAL_VAR_INIT(use_preloader, FALSE)
GLOBAL_DATUM_INIT(_preloader, /datum/map_preloader, new)
/// Preloader datum
/datum/map_preloader
parent_type = /datum
var/list/attributes
var/target_path
/datum/map_preloader/proc/setup(list/the_attributes, path)
if(the_attributes.len)
GLOB.use_preloader = TRUE
attributes = the_attributes
target_path = path
/datum/map_preloader/proc/load(atom/what)
GLOB.use_preloader = FALSE
for(var/attribute in attributes)
var/value = attributes[attribute]
if(islist(value))
value = deepCopyList(value)
#ifdef TESTING
if(what.vars[attribute] == value)
var/message = "<font color=green>[what.type]</font> at [AREACOORD(what)] - <b>VAR:</b> <font color=red>[attribute] = [isnull(value) ? "null" : (isnum(value) ? value : "\"[value]\"")]</font>"
log_mapping("DIRTY VAR: [message]")
GLOB.dirty_vars += message
#endif
what.vars[attribute] = value
/area/template_noop
name = "Area Passthrough"
/turf/template_noop
name = "Turf Passthrough"
icon_state = "noop"
bullet_bounce_sound = null