From 12ce9a564747b23215c8cdcd253baf026e30fa62 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Thu, 7 Jul 2016 00:27:57 -0700 Subject: [PATCH] Prevents the maploader from resetting when another map is loaded at the same time --- code/modules/awaymissions/maploader/reader.dm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index 15ae4fe8781..c8e660a8e00 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -41,8 +41,11 @@ var/global/dmm_suite/preloader/_preloader = new var/list/grid_models = list() var/key_len = 0 - dmmRegex.next = 1 - while(dmmRegex.Find(tfile, dmmRegex.next)) + var/dmm_suite/loaded_map/LM = new + + LM.index = 1 + while(dmmRegex.Find(tfile, LM.index)) + LM.index = dmmRegex.next // "aa" = (/type{vars=blah}) if(dmmRegex.group[1]) // Model @@ -131,6 +134,8 @@ var/global/dmm_suite/preloader/_preloader = new CHECK_TICK + qdel(LM) + if(bounds[1] == 1.#INF) // Shouldn't need to check every item return null else @@ -395,6 +400,10 @@ var/global/dmm_suite/preloader/_preloader = new what.vars[attribute] = value use_preloader = FALSE +/dmm_suite/loaded_map + parent_type = /datum + var/index = 1 // To store the state of the regex + /area/template_noop name = "Area Passthrough"