Merge pull request #51750 from ivanmixo/wallet_fix

Fixes the wallet alt-click so you can't take your ID out while unconscious or in soft crit
This commit is contained in:
ShizCalev
2020-06-30 18:54:29 -04:00
committed by GitHub
2 changed files with 10 additions and 12 deletions
@@ -1,5 +1,5 @@
/datum/component/storage/concrete/wallet/on_alt_click(datum/source, mob/user)
if(!isliving(user) || !user.CanReach(parent))
if(!isliving(user) || !user.CanReach(parent) || user.incapacitated())
return
if(locked)
to_chat(user, "<span class='warning'>[parent] seems to be locked!</span>")
+9 -11
View File
@@ -780,7 +780,7 @@
return hide_from(target)
/datum/component/storage/proc/on_alt_click(datum/source, mob/user)
if(!isliving(user) || !user.CanReach(parent))
if(!isliving(user) || !user.CanReach(parent) || user.incapacitated())
return
if(locked)
to_chat(user, "<span class='warning'>[parent] seems to be locked!</span>")
@@ -793,17 +793,15 @@
playsound(A, "rustle", 50, TRUE, -5)
return
if(!user.incapacitated())
var/obj/item/I = locate() in real_location()
if(!I)
return
A.add_fingerprint(user)
remove_from_storage(I, get_turf(user))
if(!user.put_in_hands(I))
to_chat(user, "<span class='notice'>You fumble for [I] and it falls on the floor.</span>")
return
user.visible_message("<span class='warning'>[user] draws [I] from [parent]!</span>", "<span class='notice'>You draw [I] from [parent].</span>")
var/obj/item/I = locate() in real_location()
if(!I)
return
A.add_fingerprint(user)
remove_from_storage(I, get_turf(user))
if(!user.put_in_hands(I))
to_chat(user, "<span class='notice'>You fumble for [I] and it falls on the floor.</span>")
return
user.visible_message("<span class='warning'>[user] draws [I] from [parent]!</span>", "<span class='notice'>You draw [I] from [parent].</span>")
/datum/component/storage/proc/action_trigger(datum/signal_source, datum/action/source)
gather_mode_switch(source.owner)