Skip to content

Commit

Permalink
Fixes maploader landmark.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 23, 2024
1 parent 0d75fff commit 9cf745f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions code/controllers/subsystems/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ SUBSYSTEM_DEF(mapping)
for(var/datum/map_template/MT as anything in get_all_template_instances())
register_map_template(MT)

// Load any queued map template markers.
for(var/obj/abstract/landmark/map_load_mark/queued_mark in queued_markers)
queued_mark.load_subtemplate()
queued_markers.Cut()

// Populate overmap.
if(length(global.using_map.overmap_ids))
for(var/overmap_id in global.using_map.overmap_ids)
Expand Down
11 changes: 8 additions & 3 deletions code/modules/maps/helper_landmarks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
var/centered = TRUE
var/list/map_template_names //list of template names to pick from

/obj/abstract/landmark/map_load_mark/New(loc)
..()
INITIALIZE_IMMEDIATE(/obj/abstract/landmark/map_load_mark)
/obj/abstract/landmark/map_load_mark/Initialize()
. = ..()
if(Master.map_loading) // If we're created while a map is being loaded
return // Let after_load() handle us
if(!SSmapping.initialized) // If we're being created prior to SSmapping
Expand All @@ -14,11 +15,15 @@
// How did we get here?
// These should only be loaded from compiled maps or map templates.
PRINT_STACK_TRACE("map_load_mark created outside of maploading")
load_subtemplate()
init_load_subtemplate()

/obj/abstract/landmark/map_load_mark/proc/get_subtemplate()
. = LAZYLEN(map_template_names) && pick(map_template_names)

/obj/abstract/landmark/map_load_mark/proc/init_load_subtemplate()
set waitfor = FALSE
load_subtemplate()

/obj/abstract/landmark/map_load_mark/proc/load_subtemplate()
// Commenting this out temporarily as DMMS breaks when asychronously
// loading overlapping map templates. TODO: more robust queuing behavior
Expand Down

0 comments on commit 9cf745f

Please sign in to comment.