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:
Tad Hardesty
2019-01-06 20:39:27 +13:00
committed by oranges
parent 380bbad300
commit 3b2c0e27f7
22 changed files with 78 additions and 87 deletions
+1 -1
View File
@@ -121,7 +121,7 @@
flick(icon_deny, src)
if(href_list["purchase"])
if(istype(inserted_id))
var/datum/data/mining_equipment/prize = locate(href_list["purchase"])
var/datum/data/mining_equipment/prize = locate(href_list["purchase"]) in prize_list
if (!prize || !(prize in prize_list))
to_chat(usr, "<span class='warning'>Error: Invalid choice!</span>")
flick(icon_deny, src)