diff --git a/code/datums/shuttle.dm b/code/datums/shuttle.dm index 6ba053ca806..7d84a9d3dae 100644 --- a/code/datums/shuttle.dm +++ b/code/datums/shuttle.dm @@ -580,7 +580,7 @@ var/list/our_own_turfs = list() //Go through all turfs in our area - for(var/turf/T in linked_area.get_turfs()) + for(var/turf/T in linked_area.contents) var/datum/coords/C = new(T.x,T.y) turfs_to_move += C turfs_to_move[C] = T @@ -857,7 +857,7 @@ var/rotate = dir2angle(turn(user.dir,180)) - dir2angle(linked_port.dir) var/list/original_coords = list() - for(var/turf/T in linked_area.get_turfs()) + for(var/turf/T in linked_area.contents) var/datum/coords/C = new(T.x,T.y) original_coords += C diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index dc3c58f5c3e..1c8e85d6b84 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -487,13 +487,6 @@ var/area/space_area if(areaapc == apctoremove) areaapc = null -/area/proc/get_turfs() - var/list/L = list() - for(var/turf/T in contents) - L += T - - return L - /area/proc/get_atoms() var/list/L = list() for(var/atom/A in contents) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 9bc37bd5ee4..6b6b1afa538 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1333,8 +1333,8 @@ var/global/floorIsLava = 0 if(!chosen) return - //preloader is hooked to atom/New(), and is automatically deleted once it 'loads' an object - _preloader = new(varchanges, chosen) + //preloader is hooked to atom/New(), and is automatically disabled once it 'loads' an object + _preloader.setup(varchanges, chosen) if(ispath(chosen,/turf)) var/turf/T = get_turf(usr.loc) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index d22a71cce59..198aaba2695 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1298,7 +1298,7 @@ var/global/blood_virus_spreading_disabled = 0 feedback_add_details("admin_verb","SD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! if(varchanges.len) - _preloader = new(varchanges, chosen) + _preloader.setup(varchanges, chosen) //_preloaded calls load() automatically on atom/New(). However, this proc can also create datums, which don't do that - call load() manually _preloader.load(holder.marked_datum) diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm index 7ad8883c5ec..7e05eaf3ab7 100644 --- a/code/modules/awaymissions/maploader/reader.dm +++ b/code/modules/awaymissions/maploader/reader.dm @@ -2,9 +2,6 @@ //SS13 Optimized Map loader ////////////////////////////////////////////////////////////// -//global datum that will preload variables on atoms instanciation -var/global/dmm_suite/preloader/_preloader = null - /** * Returns a list with two numbers. First number is the map's width. Second number is the map's height. */ @@ -63,7 +60,7 @@ var/list/map_dimension_cache = list() if(!map_element.can_rotate) //Abort rotation if disabled on map element rotate = 0 - + if(!z_offset)//what z_level we are creating the map on z_offset = world.maxz+1 @@ -285,7 +282,7 @@ var/list/map_dimension_cache = list() //first instance the /area and remove it from the members list index = members.len var/atom/instance - _preloader = new(members_attributes[index])//preloader for assigning set variables on atom creation + _preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation //Locate the area object instance = locate(members[index]) @@ -294,7 +291,7 @@ var/list/map_dimension_cache = list() instance.contents.Add(locate(xcrd,ycrd,zcrd)) spawned_atoms.Add(instance) - if(_preloader && instance) + if(use_preloader && instance) _preloader.load(instance) //The areas list doesn't contain areas without objects by default @@ -354,7 +351,7 @@ var/list/map_dimension_cache = list() if(!path) return var/atom/instance - _preloader = new(attributes, path) + _preloader.setup(attributes, path) if(ispath(path, /turf)) //Turfs use ChangeTurf var/turf/oldTurf = locate(x,y,z) @@ -367,7 +364,7 @@ var/list/map_dimension_cache = list() if(rotate && instance) instance.shuttle_rotate(rotate) - if(_preloader && instance)//second preloader pass, for those atoms that don't ..() in New() + if(use_preloader && instance)//second preloader pass, for those atoms that don't ..() in New() _preloader.load(instance) return instance @@ -472,7 +469,7 @@ var/list/map_dimension_cache = list() T.has_opaque_atom = TRUE // No need to recalculate it in this case, it's guaranteed to be on afterwards anyways. //atom creation method that preloads variables at creation - if(_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() + if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() _preloader.load(src) . = ..() @@ -481,20 +478,25 @@ var/list/map_dimension_cache = list() //Preloader datum ////////////////// +//global datum that will preload variables on atoms instanciation +var/global/dmm_suite/preloader/_preloader = new +var/use_preloader = FALSE + /dmm_suite/preloader parent_type = /datum var/list/attributes var/target_path -/dmm_suite/preloader/New(var/list/the_attributes, var/path) - .=..() +/dmm_suite/preloader/proc/setup(list/the_attributes, path) if(!the_attributes.len) - Del() return + use_preloader = TRUE attributes = the_attributes target_path = path /dmm_suite/preloader/proc/load(atom/what) - for(var/attribute in attributes - lockedvars) - what.vars[attribute] = attributes[attribute] - Del() + use_preloader = FALSE + var/list/local_attributes = attributes + var/list/what_vars = what.vars + for(var/attribute in local_attributes) + what_vars[attribute] = local_attributes[attribute] diff --git a/code/modules/randomMaps/vaults.dm b/code/modules/randomMaps/vaults.dm index 75598909683..0adfa1e0e01 100644 --- a/code/modules/randomMaps/vaults.dm +++ b/code/modules/randomMaps/vaults.dm @@ -124,7 +124,7 @@ if(ispath(A, /area)) A = locate(A) if(isarea(A)) - area_turfs = A.get_turfs() + area_turfs = A.contents else if(istype(A, /list)) area_turfs = A ASSERT(area_turfs) @@ -223,7 +223,7 @@ else message_admins("Can't find [ME.file_path]!") - sleep(-1) + CHECK_TICK return successes