pAI and Held Mob Locations (#510)

Fixes #489
This commit is contained in:
NanakoAC
2016-07-12 15:11:35 +03:00
committed by skull132
parent 6e00593de0
commit c7a5186ef3
7 changed files with 393 additions and 40 deletions
@@ -1198,6 +1198,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
user.drop_item()
C.loc = src
pai = C
pai.update_location()//This notifies the pAI that they've been slotted into a PDA
user << "<span class='notice'>You slot \the [C] into [src].</span>"
nanomanager.update_uis(src) // update all UIs attached to src
else if(istype(C, /obj/item/weapon/pen))
+21 -1
View File
@@ -323,4 +323,24 @@
if(pai && pai.client && !pai.canmove)
var/rendered = "<span class='message'>[text]</span>"
pai.show_message(rendered, 2)
..()
..()
/obj/item/device/paicard/dropped(mob/user)
///When an object is put into a container, drop fires twice.
//once with it on the floor, and then once in the container
//We only care about the second one
if (istype(loc, /obj/item/weapon/storage)) //The second drop reads the container its placed into as the location
update_location()
/obj/item/device/paicard/equipped(var/mob/user, var/slot)
..()
update_location(slot)
/obj/item/device/paicard/proc/update_location(var/slotnumber = null)
if (!slotnumber)
if (istype(loc, /mob))
slotnumber = get_equip_slot()
report_onmob_location(1, slotnumber, pai)