mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Scope various unscoped locate() calls (#42195)
* Scope locate calls which are immediately checked against a list * Remove silly use of locate from bible Topic * Scope various locate calls (needs testing) * More WIP * Buff up lightswitches while we're here * Tidy record browsing code * Scope a few more locates These have caused problems in the past (#41917, #39303). Continues #29349. Also cleans up lightswitch code while I was already touching it. I recommend a testmerge.
This commit is contained in:
@@ -330,7 +330,8 @@
|
||||
return
|
||||
switch(action)
|
||||
if("swap")
|
||||
var/mob/living/carbon/human/selected = locate(params["ref"])
|
||||
var/datum/species/jelly/slime/SS = H.dna.species
|
||||
var/mob/living/carbon/human/selected = locate(params["ref"]) in SS.bodies
|
||||
if(!can_swap(selected))
|
||||
return
|
||||
SStgui.close_uis(src)
|
||||
|
||||
@@ -349,7 +349,7 @@
|
||||
unset_machine()
|
||||
src << browse(null, t1)
|
||||
if (href_list["switchcamera"])
|
||||
switchCamera(locate(href_list["switchcamera"])) in GLOB.cameranet.cameras
|
||||
switchCamera(locate(href_list["switchcamera"]) in GLOB.cameranet.cameras)
|
||||
if (href_list["showalerts"])
|
||||
ai_alerts()
|
||||
#ifdef AI_VOX
|
||||
@@ -362,7 +362,7 @@
|
||||
src << browse(last_paper_seen, "window=show_paper")
|
||||
//Carn: holopad requests
|
||||
if(href_list["jumptoholopad"])
|
||||
var/obj/machinery/holopad/H = locate(href_list["jumptoholopad"])
|
||||
var/obj/machinery/holopad/H = locate(href_list["jumptoholopad"]) in GLOB.machines
|
||||
if(H)
|
||||
H.attack_ai(src) //may as well recycle
|
||||
else
|
||||
@@ -404,7 +404,7 @@
|
||||
return
|
||||
|
||||
if (href_list["ai_take_control"]) //Mech domination
|
||||
var/obj/mecha/M = locate(href_list["ai_take_control"])
|
||||
var/obj/mecha/M = locate(href_list["ai_take_control"]) in GLOB.mechas_list
|
||||
if (!M)
|
||||
return
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
if(silent)
|
||||
return alert("Communications circuits remain uninitialized.")
|
||||
|
||||
var/target = locate(href_list["target"])
|
||||
var/target = locate(href_list["target"]) in GLOB.PDAs
|
||||
pda.create_message(src, target)
|
||||
|
||||
// Accessing medical records
|
||||
|
||||
Reference in New Issue
Block a user