diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm
index 3000c0ac197..c41f422575a 100644
--- a/code/controllers/subsystem/events.dm
+++ b/code/controllers/subsystem/events.dm
@@ -111,7 +111,7 @@ SUBSYSTEM_DEF(events)
/area/crew_quarters/heads/chief)
//Need to locate() as it's just a list of paths.
- return locate(pick((GLOB.the_station_areas - safe_areas) + danger_areas))
+ return locate(pick((GLOB.the_station_areas - safe_areas) + danger_areas)) in GLOB.sortedAreas
//allows a client to trigger an event
diff --git a/code/controllers/subsystem/pai.dm b/code/controllers/subsystem/pai.dm
index ea6d57088fd..ad63f0eaf4d 100644
--- a/code/controllers/subsystem/pai.dm
+++ b/code/controllers/subsystem/pai.dm
@@ -10,8 +10,8 @@ SUBSYSTEM_DEF(pai)
/datum/controller/subsystem/pai/Topic(href, href_list[])
if(href_list["download"])
- var/datum/paiCandidate/candidate = locate(href_list["candidate"])
- var/obj/item/device/paicard/card = locate(href_list["device"])
+ var/datum/paiCandidate/candidate = locate(href_list["candidate"]) in candidates
+ var/obj/item/device/paicard/card = locate(href_list["device"]) in pai_card_list
if(card.pai)
return
if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate))
@@ -34,7 +34,7 @@ SUBSYSTEM_DEF(pai)
usr << browse(null, "window=findPai")
if(href_list["new"])
- var/datum/paiCandidate/candidate = locate(href_list["candidate"])
+ var/datum/paiCandidate/candidate = locate(href_list["candidate"]) in candidates
var/option = href_list["option"]
var/t = ""
diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index b9c90ce4f50..4ec48872c97 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -485,7 +485,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["mob_player_panel"])
+ var/mob/M = locate(href_list["mob_player_panel"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -497,7 +497,7 @@
if(!check_rights(R_ADMIN))
return
- var/mob/M = locate(href_list["godmode"])
+ var/mob/M = locate(href_list["godmode"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -540,7 +540,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["regenerateicons"])
+ var/mob/M = locate(href_list["regenerateicons"]) in GLOB.mob_list
if(!ismob(M))
to_chat(usr, "This can only be done to instances of type /mob")
return
@@ -557,7 +557,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["rename"])
+ var/mob/M = locate(href_list["rename"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -705,7 +705,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["give_spell"])
+ var/mob/M = locate(href_list["give_spell"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -717,7 +717,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["remove_spell"])
+ var/mob/M = locate(href_list["remove_spell"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -729,7 +729,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["give_disease"])
+ var/mob/M = locate(href_list["give_disease"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -741,7 +741,7 @@
if(!check_rights(R_FUN))
return
- var/mob/M = locate(href_list["gib"])
+ var/mob/M = locate(href_list["gib"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -752,7 +752,7 @@
if(!check_rights(R_BUILDMODE))
return
- var/mob/M = locate(href_list["build_mode"])
+ var/mob/M = locate(href_list["build_mode"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -764,7 +764,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["drop_everything"])
+ var/mob/M = locate(href_list["drop_everything"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -776,7 +776,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["direct_control"])
+ var/mob/M = locate(href_list["direct_control"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -788,7 +788,7 @@
if(!check_rights(0))
return
- var/mob/M = locate(href_list["offer_control"])
+ var/mob/M = locate(href_list["offer_control"]) in GLOB.mob_list
if(!istype(M))
to_chat(usr, "This can only be used on instances of type /mob")
return
@@ -921,7 +921,7 @@
if(!check_rights(0))
return
- var/mob/living/carbon/C = locate(href_list["editorgans"])
+ var/mob/living/carbon/C = locate(href_list["editorgans"]) in GLOB.mob_list
if(!istype(C))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
@@ -933,7 +933,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/monkey/Mo = locate(href_list["makehuman"])
+ var/mob/living/carbon/monkey/Mo = locate(href_list["makehuman"]) in GLOB.mob_list
if(!istype(Mo))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/monkey")
return
@@ -949,7 +949,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/human/H = locate(href_list["makemonkey"])
+ var/mob/living/carbon/human/H = locate(href_list["makemonkey"]) in GLOB.mob_list
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
@@ -965,7 +965,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/human/H = locate(href_list["makerobot"])
+ var/mob/living/carbon/human/H = locate(href_list["makerobot"]) in GLOB.mob_list
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
@@ -981,7 +981,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/human/H = locate(href_list["makealien"])
+ var/mob/living/carbon/human/H = locate(href_list["makealien"]) in GLOB.mob_list
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
@@ -997,7 +997,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/human/H = locate(href_list["makeslime"])
+ var/mob/living/carbon/human/H = locate(href_list["makeslime"]) in GLOB.mob_list
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
@@ -1013,7 +1013,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/H = locate(href_list["makeai"])
+ var/mob/living/carbon/H = locate(href_list["makeai"]) in GLOB.mob_list
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
@@ -1029,7 +1029,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/human/H = locate(href_list["setspecies"])
+ var/mob/living/carbon/human/H = locate(href_list["setspecies"]) in GLOB.mob_list
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
@@ -1049,7 +1049,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/C = locate(href_list["editbodypart"])
+ var/mob/living/carbon/C = locate(href_list["editbodypart"]) in GLOB.mob_list
if(!istype(C))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon")
return
@@ -1095,7 +1095,7 @@
if(!check_rights(R_SPAWN))
return
- var/mob/living/carbon/human/H = locate(href_list["purrbation"])
+ var/mob/living/carbon/human/H = locate(href_list["purrbation"]) in GLOB.mob_list
if(!istype(H))
to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human")
return
@@ -1126,7 +1126,7 @@
if(!check_rights(0))
return
- var/mob/living/L = locate(href_list["mobToDamage"])
+ var/mob/living/L = locate(href_list["mobToDamage"]) in GLOB.mob_list
if(!istype(L))
return
diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm
index 962fd0a6fcf..b2f57b17191 100644
--- a/code/game/gamemodes/nuclear/nuclearbomb.dm
+++ b/code/game/gamemodes/nuclear/nuclearbomb.dm
@@ -83,7 +83,7 @@
/obj/machinery/nuclearbomb/syndicate/Initialize()
. = ..()
- var/obj/machinery/nuclearbomb/existing = locate("syndienuke")
+ var/obj/machinery/nuclearbomb/existing = locate("syndienuke") in GLOB.nuke_list
if(existing)
qdel(src)
throw EXCEPTION("Attempted to spawn a syndicate nuke while one already exists at [existing.loc.x],[existing.loc.y],[existing.loc.z]")
diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm
index 21139bd3cec..c60446b973e 100644
--- a/code/game/gamemodes/nuclear/pinpointer.dm
+++ b/code/game/gamemodes/nuclear/pinpointer.dm
@@ -89,7 +89,7 @@
return
switch(mode)
if(TRACK_NUKE_DISK)
- var/obj/item/weapon/disk/nuclear/N = locate()
+ var/obj/item/weapon/disk/nuclear/N = locate() in GLOB.poi_list
target = N
if(TRACK_MALF_AI)
for(var/V in GLOB.ai_list)
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 3633146e4e7..3266a4820aa 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -604,7 +604,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
/datum/objective/capture/check_completion()//Basically runs through all the mobs in the area to determine how much they are worth.
var/captured_amount = 0
- var/area/centcom/holding/A = locate()
+ var/area/centcom/holding/A = locate() in GLOB.sortedAreas
for(var/mob/living/carbon/human/M in A)//Humans.
if(M.stat==2)//Dead folks are worth less.
captured_amount+=0.5
diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm
index 9186872f586..b8db71b7b84 100644
--- a/code/game/gamemodes/wizard/spellbook.dm
+++ b/code/game/gamemodes/wizard/spellbook.dm
@@ -76,7 +76,7 @@
return 0
/datum/spellbook_entry/proc/Refund(mob/living/carbon/human/user,obj/item/weapon/spellbook/book) //return point value or -1 for failure
- var/area/wizard_station/A = locate()
+ var/area/wizard_station/A = locate() in GLOB.sortedAreas
if(!(user in A.contents))
to_chat(user, "You can only refund spells at the wizard lair")
return -1
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 1e5925c076e..ce14d9406ee 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -152,7 +152,7 @@
return FALSE
if(mess || attempting)
return FALSE
- clonemind = locate(mindref)
+ clonemind = locate(mindref) in SSticker.minds
if(!istype(clonemind)) //not a mind
return FALSE
if( clonemind.current && clonemind.current.stat != DEAD ) //mind is associated with a non-dead body
diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm
index 1bd299a40b0..11c0825beb8 100644
--- a/code/game/machinery/computer/robot.dm
+++ b/code/game/machinery/computer/robot.dm
@@ -158,7 +158,7 @@
else if (href_list["killdrone"])
if(src.allowed(usr))
- var/mob/living/simple_animal/drone/D = locate(href_list["killdrone"])
+ var/mob/living/simple_animal/drone/D = locate(href_list["killdrone"]) in GLOB.mob_list
if(D.hacked)
to_chat(usr, "ERROR: [D] is not responding to external commands.")
else