Adds proper containers for some locates

This commit is contained in:
Lzimann
2017-07-18 16:23:10 -03:00
parent 959587c2fc
commit c92ec9c5e4
9 changed files with 33 additions and 33 deletions

View File

@@ -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

View File

@@ -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 = ""

View File

@@ -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

View File

@@ -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]")

View File

@@ -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)

View File

@@ -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

View File

@@ -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, "<span class='warning'>You can only refund spells at the wizard lair</span>")
return -1

View File

@@ -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

View File

@@ -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, "<span class='danger'>ERROR: [D] is not responding to external commands.</span>")
else