diff --git a/code/__defines/mapping.dm b/code/__defines/mapping.dm index 47b24b30658..c5ad65832e3 100644 --- a/code/__defines/mapping.dm +++ b/code/__defines/mapping.dm @@ -33,9 +33,10 @@ if(other_init) { \ #define ADJUST_TAG_VAR(variable, map_hash) (istext(variable) && (variable += map_hash)) /// Map template categories for mass retrieval. -#define MAP_TEMPLATE_CATEGORY_EXOPLANET "exoplanet_template" -#define MAP_TEMPLATE_CATEGORY_EXOPLANET_SITE "exoplanet_site_template" -#define MAP_TEMPLATE_CATEGORY_PLANET "planet_template" -#define MAP_TEMPLATE_CATEGORY_PLANET_SITE "planet_site_template" -#define MAP_TEMPLATE_CATEGORY_SPACE "space_template" -#define MAP_TEMPLATE_CATEGORY_AWAYSITE "awaysite_template" +#define MAP_TEMPLATE_CATEGORY_EXOPLANET "exoplanet_template" +#define MAP_TEMPLATE_CATEGORY_EXOPLANET_SITE "exoplanet_site_template" +#define MAP_TEMPLATE_CATEGORY_PLANET "planet_template" +#define MAP_TEMPLATE_CATEGORY_PLANET_SITE "planet_site_template" +#define MAP_TEMPLATE_CATEGORY_SPACE "space_template" +#define MAP_TEMPLATE_CATEGORY_AWAYSITE "awaysite_template" +#define MAP_TEMPLATE_CATEGORY_LANDMARK_LOADED "landmark_template" \ No newline at end of file diff --git a/code/controllers/subsystems/mapping.dm b/code/controllers/subsystems/mapping.dm index 7f54be02b57..d1d8c7326f9 100644 --- a/code/controllers/subsystems/mapping.dm +++ b/code/controllers/subsystems/mapping.dm @@ -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) diff --git a/code/modules/maps/helper_landmarks.dm b/code/modules/maps/helper_landmarks.dm index 76e4e23cb4b..e8c4a5b7547 100644 --- a/code/modules/maps/helper_landmarks.dm +++ b/code/modules/maps/helper_landmarks.dm @@ -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 @@ -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 diff --git a/code/unit_tests/~unit_test_subsystems.dm b/code/unit_tests/~unit_test_subsystems.dm index 31b6c97c7eb..9cb2e10f314 100644 --- a/code/unit_tests/~unit_test_subsystems.dm +++ b/code/unit_tests/~unit_test_subsystems.dm @@ -16,6 +16,7 @@ SUBSYSTEM_DEF(unit_tests) MAP_TEMPLATE_CATEGORY_AWAYSITE, MAP_TEMPLATE_CATEGORY_PLANET, MAP_TEMPLATE_CATEGORY_EXOPLANET, + MAP_TEMPLATE_CATEGORY_LANDMARK_LOADED ) /datum/controller/subsystem/unit_tests/Initialize(timeofday) diff --git a/test/check-paths.sh b/test/check-paths.sh index a775484c4da..2831ada98b2 100755 --- a/test/check-paths.sh +++ b/test/check-paths.sh @@ -40,7 +40,7 @@ exactly 0 "incorrect indentations" '^( {4,})' -P exactly 24 "text2path uses" 'text2path' exactly 4 "update_icon() override" '/update_icon\((.*)\)' -P exactly 0 "goto uses" 'goto ' -exactly 6 "atom/New uses" '^/(obj|atom|area|mob|turf).*/New\(' +exactly 5 "atom/New uses" '^/(obj|atom|area|mob|turf).*/New\(' exactly 1 "decl/New uses" '^/decl.*/New\(' exactly 0 "tag uses" '\stag = ' -P '**/*.dmm' exactly 3 "unmarked globally scoped variables" -P '^(/|)var/(?!global)'