diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index bacedad6c07..bb976af96b5 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -346,16 +346,14 @@ What a mess.*/
active2 = null
if("Browse Record")
- var/datum/data/record/R = locate(href_list["d_rec"])
- var/S = locate(href_list["d_rec"])
- if(!( GLOB.data_core.general.Find(R) ))
+ var/datum/data/record/R = locate(href_list["d_rec"]) in GLOB.data_core.general
+ if(!R)
temp = "Record Not Found!"
else
+ active1 = active2 = R
for(var/datum/data/record/E in GLOB.data_core.security)
if((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
- S = E
- active1 = R
- active2 = S
+ active2 = E
screen = 3
diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm
index dcf69ea2b32..222aaa26b01 100644
--- a/code/game/machinery/gulag_item_reclaimer.dm
+++ b/code/game/machinery/gulag_item_reclaimer.dm
@@ -94,7 +94,7 @@
inserted_id = I
if("release_items")
- var/mob/M = locate(params["mobref"])
+ var/mob/M = locate(params["mobref"]) in stored_items
if(M == usr || allowed(usr))
if(inserted_id)
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_SEC)
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index 68ed9bc5216..9fde7d60f0e 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -281,13 +281,13 @@ Possible to do for anyone motivated enough:
new /datum/holocall(usr, src, callnames[result])
else if(href_list["connectcall"])
- var/datum/holocall/call_to_connect = locate(href_list["connectcall"])
+ var/datum/holocall/call_to_connect = locate(href_list["connectcall"]) in holo_calls
if(!QDELETED(call_to_connect))
call_to_connect.Answer(src)
temp = ""
else if(href_list["disconnectcall"])
- var/datum/holocall/call_to_disconnect = locate(href_list["disconnectcall"])
+ var/datum/holocall/call_to_disconnect = locate(href_list["disconnectcall"]) in holo_calls
if(!QDELETED(call_to_disconnect))
call_to_disconnect.Disconnect(src)
temp = ""
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index cbb9b4f2531..58afb4940bf 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -1,63 +1,59 @@
-// the light switch
-// can have multiple per area
-// can also operate on non-loc area through "otherarea" var
+/// The light switch. Can have multiple per area.
/obj/machinery/light_switch
name = "light switch"
icon = 'icons/obj/power.dmi'
icon_state = "light1"
desc = "Make dark."
- var/on = TRUE
+ /// Set this to a string, path, or area instance to control that area
+ /// instead of the switch's location.
var/area/area = null
- var/otherarea = null
/obj/machinery/light_switch/Initialize()
. = ..()
- area = get_area(src)
-
- if(otherarea)
- area = locate(text2path("/area/[otherarea]"))
+ if(istext(area))
+ area = text2path(area)
+ if(ispath(area))
+ area = GLOB.areas_by_type[area]
+ if(!area)
+ area = get_area(src)
if(!name)
name = "light switch ([area.name])"
- on = area.lightswitch
- updateicon()
+ update_icon()
-/obj/machinery/light_switch/proc/updateicon()
+/obj/machinery/light_switch/update_icon()
if(stat & NOPOWER)
icon_state = "light-p"
else
- if(on)
+ if(area.lightswitch)
icon_state = "light1"
else
icon_state = "light0"
/obj/machinery/light_switch/examine(mob/user)
..()
- to_chat(user, "It is [on? "on" : "off"].")
+ to_chat(user, "It is [area.lightswitch ? "on" : "off"].")
/obj/machinery/light_switch/interact(mob/user)
. = ..()
- on = !on
- area.lightswitch = on
+ area.lightswitch = !area.lightswitch
area.updateicon()
for(var/obj/machinery/light_switch/L in area)
- L.on = on
- L.updateicon()
+ L.update_icon()
area.power_change()
/obj/machinery/light_switch/power_change()
-
- if(!otherarea)
+ if(area == get_area(src))
if(powered(LIGHT))
stat &= ~NOPOWER
else
stat |= NOPOWER
- updateicon()
+ update_icon()
/obj/machinery/light_switch/emp_act(severity)
. = ..()
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index 35eb474921f..a678ee308d3 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -634,33 +634,33 @@ GLOBAL_LIST_EMPTY(allCasters)
screen=18
updateUsrDialog()
else if(href_list["censor_channel_author"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["censor_channel_author"])
+ var/datum/newscaster/feed_channel/FC = locate(href_list["censor_channel_author"]) in GLOB.news_network.network_channels
if(FC.is_admin_channel)
alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok")
return
FC.toggleCensorAuthor()
updateUsrDialog()
else if(href_list["censor_channel_story_author"])
- var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_author"])
+ var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_author"]) in viewing_channel.messages
if(MSG.is_admin_message)
alert("This message was created by a Nanotrasen Officer. You cannot censor its author.","Ok")
return
MSG.toggleCensorAuthor()
updateUsrDialog()
else if(href_list["censor_channel_story_body"])
- var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_body"])
+ var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_body"]) in viewing_channel.messages
if(MSG.is_admin_message)
alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok")
return
MSG.toggleCensorBody()
updateUsrDialog()
else if(href_list["pick_d_notice"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["pick_d_notice"])
+ var/datum/newscaster/feed_channel/FC = locate(href_list["pick_d_notice"]) in GLOB.news_network.network_channels
viewing_channel = FC
screen=13
updateUsrDialog()
else if(href_list["toggle_d_notice"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["toggle_d_notice"])
+ var/datum/newscaster/feed_channel/FC = locate(href_list["toggle_d_notice"]) in GLOB.news_network.network_channels
if(FC.is_admin_channel)
alert("This channel was created by a Nanotrasen Officer. You cannot place a D-Notice upon it.","Ok")
return
@@ -679,17 +679,17 @@ GLOBAL_LIST_EMPTY(allCasters)
viewing_channel = null
updateUsrDialog()
else if(href_list["show_channel"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["show_channel"])
+ var/datum/newscaster/feed_channel/FC = locate(href_list["show_channel"]) in GLOB.news_network.network_channels
viewing_channel = FC
screen = 9
updateUsrDialog()
else if(href_list["pick_censor_channel"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["pick_censor_channel"])
+ var/datum/newscaster/feed_channel/FC = locate(href_list["pick_censor_channel"]) in GLOB.news_network.network_channels
viewing_channel = FC
screen = 12
updateUsrDialog()
else if(href_list["new_comment"])
- var/datum/newscaster/feed_message/FM = locate(href_list["new_comment"])
+ var/datum/newscaster/feed_message/FM = locate(href_list["new_comment"]) in viewing_channel.messages
var/cominput = copytext(stripped_input(usr, "Write your message:", "New comment", null),1,141)
if(cominput)
scan_user(usr)
@@ -701,14 +701,14 @@ GLOBAL_LIST_EMPTY(allCasters)
usr.log_message("(as [scanned_user]) commented on message [FM.returnBody(-1)] -- [FC.body]", LOG_COMMENT)
updateUsrDialog()
else if(href_list["del_comment"])
- var/datum/newscaster/feed_comment/FC = locate(href_list["del_comment"])
- var/datum/newscaster/feed_message/FM = locate(href_list["del_comment_msg"])
+ var/datum/newscaster/feed_message/FM = locate(href_list["del_comment_msg"]) in viewing_channel.messages
+ var/datum/newscaster/feed_comment/FC = locate(href_list["del_comment"]) in FM.comments
if(istype(FC) && istype(FM))
FM.comments -= FC
qdel(FC)
updateUsrDialog()
else if(href_list["lock_comment"])
- var/datum/newscaster/feed_message/FM = locate(href_list["lock_comment"])
+ var/datum/newscaster/feed_message/FM = locate(href_list["lock_comment"]) in viewing_channel.messages
FM.locked ^= 1
updateUsrDialog()
else if(href_list["set_comment"])
diff --git a/code/game/machinery/telecomms/computers/message.dm b/code/game/machinery/telecomms/computers/message.dm
index 36abb6fba1f..e58971a2366 100644
--- a/code/game/machinery/telecomms/computers/message.dm
+++ b/code/game/machinery/telecomms/computers/message.dm
@@ -352,7 +352,7 @@
if(LINKED_SERVER_NONRESPONSIVE)
message = noserver
else //if(istype(href_list["delete_logs"], /datum/data_pda_msg))
- linkedServer.pda_msgs -= locate(href_list["delete_logs"])
+ linkedServer.pda_msgs -= locate(href_list["delete_logs"]) in linkedServer.pda_msgs
message = "NOTICE: Log Deleted!"
//Delete the request console log.
if (href_list["delete_requests"])
@@ -361,7 +361,7 @@
if(LINKED_SERVER_NONRESPONSIVE)
message = noserver
else //if(istype(href_list["delete_logs"], /datum/data_pda_msg))
- linkedServer.rc_msgs -= locate(href_list["delete_requests"])
+ linkedServer.rc_msgs -= locate(href_list["delete_requests"]) in linkedServer.rc_msgs
message = "NOTICE: Log Deleted!"
//Create a custom message
if (href_list["msg"])
diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm
index 6bfe6f456c3..c87a81b058e 100644
--- a/code/game/mecha/working/ripley.dm
+++ b/code/game/mecha/working/ripley.dm
@@ -142,8 +142,8 @@
/obj/mecha/working/ripley/Topic(href, href_list)
..()
if(href_list["drop_from_cargo"])
- var/obj/O = locate(href_list["drop_from_cargo"])
- if(O && O in src.cargo)
+ var/obj/O = locate(href_list["drop_from_cargo"]) in cargo
+ if(O)
occupant_message("You unload [O].")
O.forceMove(drop_location())
cargo -= O
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index adc1c7efeb2..6e7035805d6 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -522,7 +522,7 @@ GLOBAL_LIST_EMPTY(PDAs)
U << browse(null, "window=pda")
return
if("Message")
- create_message(U, locate(href_list["target"]))
+ create_message(U, locate(href_list["target"]) in GLOB.PDAs)
if("MessageAll")
send_to_all(U)
diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm
index ff33409d9ee..4fbe8f3e07e 100644
--- a/code/game/objects/items/devices/PDA/cart.dm
+++ b/code/game/objects/items/devices/PDA/cart.dm
@@ -652,7 +652,7 @@ Code:
switch(href_list["op"])
if("control")
- active_bot = locate(href_list["bot"])
+ active_bot = locate(href_list["bot"]) in GLOB.bots_list
if("botlist")
active_bot = null
@@ -671,10 +671,6 @@ Code:
/obj/item/cartridge/proc/bot_control()
-
-
- var/mob/living/simple_animal/bot/Bot
-
if(active_bot)
menu += "[active_bot]
Status: ([PDAIMG(refresh)]refresh)
"
menu += "Model: [active_bot.model]
"
@@ -718,7 +714,8 @@ Code:
var/turf/current_turf = get_turf(src)
var/zlevel = current_turf.z
var/botcount = 0
- for(Bot in GLOB.alive_mob_list) //Git da botz
+ for(var/B in GLOB.bots_list) //Git da botz
+ var/mob/living/simple_animal/bot/Bot = B
if(!Bot.on || Bot.z != zlevel || Bot.remote_disabled || !(bot_access_flags & Bot.bot_type)) //Only non-emagged bots on the same Z-level are detected!
continue //Also, the PDA must have access to the bot type.
menu += "[Bot.name] ([Bot.get_mode()])
"
diff --git a/code/game/objects/items/devices/PDA/virus_cart.dm b/code/game/objects/items/devices/PDA/virus_cart.dm
index 3c7113edb7e..ecd51b6b227 100644
--- a/code/game/objects/items/devices/PDA/virus_cart.dm
+++ b/code/game/objects/items/devices/PDA/virus_cart.dm
@@ -14,7 +14,7 @@
return " (*Send Virus*)"
/obj/item/cartridge/virus/special(mob/living/user, list/params)
- var/obj/item/pda/P = locate(params["target"])//Leaving it alone in case it may do something useful, I guess.
+ var/obj/item/pda/P = locate(params["target"]) in GLOB.PDAs //Leaving it alone in case it may do something useful, I guess.
send_virus(P,user)
/obj/item/cartridge/virus/clown
diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm
index 88d5d8b98fd..321f9fccb14 100644
--- a/code/game/objects/items/storage/book.dm
+++ b/code/game/objects/items/storage/book.dm
@@ -69,17 +69,16 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", "
if(href_list["seticon"] && SSreligion && !SSreligion.bible_icon_state)
var/iconi = text2num(href_list["seticon"])
var/biblename = GLOB.biblenames[iconi]
- var/obj/item/storage/book/bible/B = locate(href_list["src"])
- B.icon_state = GLOB.biblestates[iconi]
- B.item_state = GLOB.bibleitemstates[iconi]
+ icon_state = GLOB.biblestates[iconi]
+ item_state = GLOB.bibleitemstates[iconi]
- if(B.icon_state == "honk1" || B.icon_state == "honk2")
+ if(icon_state == "honk1" || icon_state == "honk2")
var/mob/living/carbon/human/H = usr
H.dna.add_mutation(CLOWNMUT)
H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(H), SLOT_WEAR_MASK)
- SSreligion.bible_icon_state = B.icon_state
- SSreligion.bible_item_state = B.item_state
+ SSreligion.bible_icon_state = icon_state
+ SSreligion.bible_item_state = item_state
SSblackbox.record_feedback("text", "religion_book", 1, "[biblename]")
usr << browse(null, "window=editicon")
diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm
index dc550175078..e038fec348e 100644
--- a/code/modules/admin/secrets.dm
+++ b/code/modules/admin/secrets.dm
@@ -126,7 +126,7 @@
log_admin("[key_name(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].", 1)
message_admins("[key_name_admin(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].")
- var/area/thunderdome = locate(/area/tdome/arena)
+ var/area/thunderdome = GLOB.areas_by_type[/area/tdome/arena]
if(delete_mobs == "Yes")
for(var/mob/living/mob in thunderdome)
qdel(mob) //Clear mobs
@@ -134,7 +134,7 @@
if(!istype(obj, /obj/machinery/camera))
qdel(obj) //Clear objects
- var/area/template = locate(/area/tdome/arena_source)
+ var/area/template = GLOB.areas_by_type[/area/tdome/arena_source]
template.copy_contents_to(thunderdome)
if("clear_virus")
diff --git a/code/modules/antagonists/disease/disease_mob.dm b/code/modules/antagonists/disease/disease_mob.dm
index 22121ec7f5c..85659b8a1ee 100644
--- a/code/modules/antagonists/disease/disease_mob.dm
+++ b/code/modules/antagonists/disease/disease_mob.dm
@@ -367,7 +367,7 @@ the new instance inside the host to be updated to the template's stats.
set_following(L)
if(href_list["buy_ability"])
- var/datum/disease_ability/A = locate(href_list["buy_ability"])
+ var/datum/disease_ability/A = locate(href_list["buy_ability"]) in unpurchased_abilities
if(!istype(A))
return
if(A.CanBuy(src))
@@ -375,7 +375,7 @@ the new instance inside the host to be updated to the template's stats.
adaptation_menu()
if(href_list["refund_ability"])
- var/datum/disease_ability/A = locate(href_list["refund_ability"])
+ var/datum/disease_ability/A = locate(href_list["refund_ability"]) in purchased_abilities
if(!istype(A))
return
if(A.CanRefund(src))
@@ -383,7 +383,7 @@ the new instance inside the host to be updated to the template's stats.
adaptation_menu()
if(href_list["examine_ability"])
- var/datum/disease_ability/A = locate(href_list["examine_ability"])
+ var/datum/disease_ability/A = locate(href_list["examine_ability"]) in GLOB.disease_ability_singletons
if(!istype(A))
return
examining_ability = A
diff --git a/code/modules/cargo/bounty_console.dm b/code/modules/cargo/bounty_console.dm
index cec12a6ba7c..28559717ebc 100644
--- a/code/modules/cargo/bounty_console.dm
+++ b/code/modules/cargo/bounty_console.dm
@@ -84,8 +84,8 @@
print_paper()
if("Claim")
- var/datum/bounty/B = locate(href_list["d_rec"])
- if(B in GLOB.bounties_list)
+ var/datum/bounty/B = locate(href_list["d_rec"]) in GLOB.bounties_list
+ if(B)
B.claim()
if(href_list["refresh"])
diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm
index ade73471275..cf8fe212da7 100644
--- a/code/modules/crafting/craft.dm
+++ b/code/modules/crafting/craft.dm
@@ -333,7 +333,7 @@
return
switch(action)
if("make")
- var/datum/crafting_recipe/TR = locate(params["recipe"])
+ var/datum/crafting_recipe/TR = locate(params["recipe"]) in GLOB.crafting_recipes
busy = TRUE
ui_interact(usr) //explicit call to show the busy display
var/fail_msg = construct_item(usr, TR)
diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm
index 26f78bf5200..8b705949980 100644
--- a/code/modules/mining/machine_vending.dm
+++ b/code/modules/mining/machine_vending.dm
@@ -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, "Error: Invalid choice!")
flick(icon_deny, src)
diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
index 985cf0d50fd..93b792751e1 100644
--- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
@@ -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)
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 4aafdb830dd..316c4be37ab 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -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
diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm
index a2973e57b74..10ecb9299b9 100644
--- a/code/modules/mob/living/silicon/pai/software.dm
+++ b/code/modules/mob/living/silicon/pai/software.dm
@@ -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
diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm
index f77c0dabee5..c3754df292e 100644
--- a/code/modules/paperwork/clipboard.dm
+++ b/code/modules/paperwork/clipboard.dm
@@ -94,14 +94,14 @@
to_chat(usr, "You slot [W] into [src].")
if(href_list["write"])
- var/obj/item/P = locate(href_list["write"])
- if(istype(P) && P.loc == src)
+ var/obj/item/P = locate(href_list["write"]) in src
+ if(istype(P))
if(usr.get_active_held_item())
P.attackby(usr.get_active_held_item(), usr)
if(href_list["remove"])
- var/obj/item/P = locate(href_list["remove"])
- if(istype(P) && P.loc == src)
+ var/obj/item/P = locate(href_list["remove"]) in src
+ if(istype(P))
P.forceMove(usr.loc)
usr.put_in_hands(P)
if(P == toppaper)
@@ -113,13 +113,13 @@
toppaper = null
if(href_list["read"])
- var/obj/item/paper/P = locate(href_list["read"])
- if(istype(P) && P.loc == src)
+ var/obj/item/paper/P = locate(href_list["read"]) in src
+ if(istype(P))
usr.examinate(P)
if(href_list["top"])
- var/obj/item/P = locate(href_list["top"])
- if(istype(P) && P.loc == src)
+ var/obj/item/P = locate(href_list["top"]) in src
+ if(istype(P))
toppaper = P
to_chat(usr, "You move [P.name] to the top.")
diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm
index 49aa65b3525..aecefefbbc7 100644
--- a/code/modules/paperwork/filingcabinet.dm
+++ b/code/modules/paperwork/filingcabinet.dm
@@ -102,8 +102,8 @@
if(href_list["retrieve"])
usr << browse("", "window=filingcabinet") // Close the menu
- var/obj/item/P = locate(href_list["retrieve"])//contents[retrieveindex]
- if(istype(P) && P.loc == src && in_range(src, usr))
+ var/obj/item/P = locate(href_list["retrieve"]) in src //contents[retrieveindex]
+ if(istype(P) && in_range(src, usr))
usr.put_in_hands(P)
updateUsrDialog()
icon_state = "[initial(icon_state)]-open"
diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm
index 038cba8936a..74c4bcecb22 100644
--- a/code/modules/paperwork/folders.dm
+++ b/code/modules/paperwork/folders.dm
@@ -67,14 +67,14 @@
if(usr.contents.Find(src))
if(href_list["remove"])
- var/obj/item/I = locate(href_list["remove"])
- if(istype(I) && I.loc == src)
+ var/obj/item/I = locate(href_list["remove"]) in src
+ if(istype(I))
I.forceMove(usr.loc)
usr.put_in_hands(I)
if(href_list["read"])
- var/obj/item/I = locate(href_list["read"])
- if(istype(I) && I.loc == src)
+ var/obj/item/I = locate(href_list["read"]) in src
+ if(istype(I))
usr.examinate(I)
//Update everything