Merge pull request #7279 from Citadel-Station-13/upstream-merge-38795
[MIRROR] [s] Fixes PDA ID teleporting
This commit is contained in:
@@ -533,10 +533,10 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
U << browse(null, "window=pda")
|
||||
return
|
||||
if("Message")
|
||||
src.create_message(U, locate(href_list["target"]))
|
||||
create_message(U, locate(href_list["target"]))
|
||||
|
||||
if("MessageAll")
|
||||
src.send_to_all(U)
|
||||
send_to_all(U)
|
||||
|
||||
if("cart")
|
||||
if(cartridge)
|
||||
@@ -562,7 +562,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
if("1") // Configure pAI device
|
||||
pai.attack_self(U)
|
||||
if("2") // Eject pAI device
|
||||
var/turf/T = get_turf(src.loc)
|
||||
var/turf/T = get_turf(loc)
|
||||
if(T)
|
||||
pai.forceMove(T)
|
||||
|
||||
@@ -593,13 +593,13 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
return
|
||||
|
||||
/obj/item/pda/proc/remove_id()
|
||||
|
||||
if(issilicon(usr) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
|
||||
if (id)
|
||||
if (ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.put_in_hands(id)
|
||||
to_chat(usr, "<span class='notice'>You remove the ID from the [name].</span>")
|
||||
else
|
||||
id.forceMove(drop_location())
|
||||
usr.put_in_hands(id)
|
||||
to_chat(usr, "<span class='notice'>You remove the ID from the [name].</span>")
|
||||
id = null
|
||||
update_icon()
|
||||
|
||||
@@ -607,9 +607,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
var/t = stripped_input(U, "Please enter message", name)
|
||||
if (!t || toff)
|
||||
return
|
||||
if (!in_range(src, U) && loc != U)
|
||||
return
|
||||
if(!U.canUseTopic(src))
|
||||
if(!U.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
if(emped)
|
||||
t = Gibberish(t, 100)
|
||||
@@ -707,57 +705,44 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
/obj/item/pda/AltClick()
|
||||
..()
|
||||
|
||||
if(issilicon(usr))
|
||||
return
|
||||
|
||||
if(usr.canUseTopic(src))
|
||||
if(id)
|
||||
remove_id()
|
||||
else
|
||||
remove_pen()
|
||||
if(id)
|
||||
remove_id()
|
||||
else
|
||||
remove_pen()
|
||||
|
||||
/obj/item/pda/CtrlClick()
|
||||
..()
|
||||
|
||||
if(issilicon(usr))
|
||||
if(isturf(loc)) //stops the user from dragging the PDA by ctrl-clicking it.
|
||||
return
|
||||
|
||||
if(usr.canUseTopic(src) && !isturf(loc))
|
||||
remove_pen()
|
||||
remove_pen()
|
||||
|
||||
/obj/item/pda/verb/verb_remove_id()
|
||||
set category = "Object"
|
||||
set name = "Eject ID"
|
||||
set src in usr
|
||||
|
||||
if(issilicon(usr))
|
||||
return
|
||||
|
||||
if (usr.canUseTopic(src))
|
||||
if(id)
|
||||
remove_id()
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>This PDA does not have an ID in it!</span>")
|
||||
if(id)
|
||||
remove_id()
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>This PDA does not have an ID in it!</span>")
|
||||
|
||||
/obj/item/pda/verb/verb_remove_pen()
|
||||
set category = "Object"
|
||||
set name = "Remove Pen"
|
||||
set src in usr
|
||||
|
||||
if(issilicon(usr))
|
||||
return
|
||||
|
||||
if (usr.canUseTopic(src))
|
||||
remove_pen()
|
||||
remove_pen()
|
||||
|
||||
/obj/item/pda/proc/remove_pen()
|
||||
|
||||
if(issilicon(usr) || !usr.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
|
||||
if(inserted_item)
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.put_in_hands(inserted_item)
|
||||
else
|
||||
inserted_item.forceMove(drop_location())
|
||||
to_chat(usr, "<span class='notice'>You remove \the [inserted_item] from \the [src].</span>")
|
||||
usr.put_in_hands(inserted_item)
|
||||
to_chat(usr, "<span class='notice'>You remove [inserted_item] from [src].</span>")
|
||||
inserted_item = null
|
||||
update_icon()
|
||||
else
|
||||
@@ -768,7 +753,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
if(!I)
|
||||
if(id)
|
||||
remove_id()
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
var/obj/item/card/id/C = user.get_active_held_item()
|
||||
if(istype(C))
|
||||
@@ -776,13 +761,13 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
|
||||
if(I && I.registered_name)
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return 0
|
||||
return FALSE
|
||||
var/obj/old_id = id
|
||||
id = I
|
||||
if(old_id)
|
||||
user.put_in_hands(old_id)
|
||||
update_icon()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
// access to status display signals
|
||||
/obj/item/pda/attackby(obj/item/C, mob/user, params)
|
||||
@@ -813,7 +798,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
updateSelfDialog()//Update self dialog on success.
|
||||
return //Return in case of failed check or when successful.
|
||||
updateSelfDialog()//For the non-input related code.
|
||||
else if(istype(C, /obj/item/paicard) && !src.pai)
|
||||
else if(istype(C, /obj/item/paicard) && !pai)
|
||||
if(!user.transferItemToLoc(C, src))
|
||||
return
|
||||
pai = C
|
||||
@@ -926,14 +911,14 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
var/list/plist = list()
|
||||
var/list/namecounts = list()
|
||||
|
||||
if(src.aiPDA.toff)
|
||||
if(aiPDA.toff)
|
||||
to_chat(user, "Turn on your receiver in order to send messages.")
|
||||
return
|
||||
|
||||
for (var/obj/item/pda/P in get_viewable_pdas())
|
||||
if (P == src)
|
||||
continue
|
||||
else if (P == src.aiPDA)
|
||||
else if (P == aiPDA)
|
||||
continue
|
||||
|
||||
plist[avoid_assoc_duplicate_keys(P.owner, namecounts)] = P
|
||||
@@ -949,12 +934,12 @@ GLOBAL_LIST_EMPTY(PDAs)
|
||||
var/add_photo = input(user,"Do you want to attach a photo?","Photo","No") as null|anything in list("Yes","No")
|
||||
if(add_photo=="Yes")
|
||||
var/datum/picture/Pic = aicamera.selectpicture(aicamera)
|
||||
src.aiPDA.photo = Pic.fields["img"]
|
||||
aiPDA.photo = Pic.fields["img"]
|
||||
|
||||
if(incapacitated())
|
||||
return
|
||||
|
||||
src.aiPDA.create_message(src, selected)
|
||||
aiPDA.create_message(src, selected)
|
||||
|
||||
|
||||
/mob/living/silicon/ai/verb/cmd_toggle_pda_receiver()
|
||||
|
||||
Reference in New Issue
Block a user