mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +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:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 = ""
|
||||
|
||||
@@ -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)
|
||||
. = ..()
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -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 = "<span class='notice'>NOTICE: Log Deleted!</span>"
|
||||
//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 = "<span class='notice'>NOTICE: Log Deleted!</span>"
|
||||
//Create a custom message
|
||||
if (href_list["msg"])
|
||||
|
||||
@@ -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("<span class='notice'>You unload [O].</span>")
|
||||
O.forceMove(drop_location())
|
||||
cargo -= O
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 += "<B>[active_bot]</B><BR> Status: (<A href='byond://?src=[REF(src)];op=control;bot=[REF(active_bot)]'>[PDAIMG(refresh)]<i>refresh</i></A>)<BR>"
|
||||
menu += "Model: [active_bot.model]<BR>"
|
||||
@@ -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 += "<A href='byond://?src=[REF(src)];op=control;bot=[REF(Bot)]'><b>[Bot.name]</b> ([Bot.get_mode()])<BR>"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
return " (<a href='byond://?src=[REF(loc)];choice=cart;special=virus;target=[REF(target)]'>*Send Virus*</a>)"
|
||||
|
||||
/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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
log_admin("[key_name(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].", 1)
|
||||
message_admins("<span class='adminnotice'>[key_name_admin(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].</span>")
|
||||
|
||||
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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -94,14 +94,14 @@
|
||||
to_chat(usr, "<span class='notice'>You slot [W] into [src].</span>")
|
||||
|
||||
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, "<span class='notice'>You move [P.name] to the top.</span>")
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user