Files
Paradise/code/modules/awaymissions/map_rng.dm
T
tigercat2000 7d8c9a731a SS Conversion: Atoms, Machines, n' Mobs
This converts the machine and mob processes to the SMC. Additionally, it
adds the Atom subsystem, which handles all Initialize() calls in place
of the old gameticker. Due to incompatibility with our atmospherics
(FUCK OUR ATMOSPHERICS FOR FUCKING EVER JESUS CHRIST WHO THE FUCK MADE
THIS PIECE OF GODDAMN SHIT) atmospherics machines do not use
Initialize() as they should, instead opting for a custom atmos_init
proc that the air controller handles.
2018-04-28 17:55:15 -07:00

52 lines
1.1 KiB
Plaintext

/obj/effect/landmark/map_loader
name = "map loader"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "x2"
invisibility = 101
anchored = 1
density = 0
opacity = 0
var/template_name = null
var/datum/map_template/template = null
var/centered = 1
var/loaded = 0
/obj/effect/landmark/map_loader/New(turf/loc, tname)
..()
if(tname)
template_name = tname
if(template_name)
template = map_templates[template_name]
/obj/effect/landmark/map_loader/Initialize()
..()
if(template)
load(template)
/obj/effect/landmark/map_loader/set_tag()
return
/obj/effect/landmark/map_loader/proc/load(datum/map_template/t)
if(!t)
return
if(loaded) // I wanna be super sure this loads only once
return
loaded = 1
var/turf/pos = get_turf(src)
// Hop to nullspace so we don't get re-initialized by the map we're loading
loc = null
t.load(pos, centered = centered)
t.loaded++
qdel(src)
/obj/effect/landmark/map_loader/random
var/template_list = ""
/obj/effect/landmark/map_loader/random/Initialize()
..()
if(template_list)
template_name = safepick(splittext(template_list, ";"))
template = map_templates[template_name]
load(template)