From 3abeb214fdac848c2d9f1c351f34791b636969f9 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Mon, 20 Aug 2018 14:57:31 -0700
Subject: [PATCH] Update _vending.dm
---
code/modules/vending/_vending.dm | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm
index 9a18480920..410952397d 100644
--- a/code/modules/vending/_vending.dm
+++ b/code/modules/vending/_vending.dm
@@ -436,12 +436,16 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
return
if(coin && coin.string_attached)
if(prob(50))
- if(usr.put_in_hands(coin))
- to_chat(usr, "You successfully pull [coin] out before [src] could swallow it.")
- coin = null
+ if(usr.CanReach(src))
+ if(usr.put_in_hands(coin))
+ to_chat(usr, "You successfully pull [coin] out before [src] could swallow it.")
+ coin = null
+ else
+ to_chat(usr, "You couldn't pull [coin] out because your hands are full!")
+ QDEL_NULL(coin)
else
- to_chat(usr, "You couldn't pull [coin] out because your hands are full!")
- QDEL_NULL(coin)
+ to_chat(usr, "You successfully pull [coin] out of [src] to the floor.")
+ coin = null
else
to_chat(usr, "You weren't able to pull [coin] out fast enough, the machine ate it, string and all!")
QDEL_NULL(coin)
@@ -469,10 +473,13 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
if(icon_vend) //Show the vending animation if needed
flick(icon_vend,src)
var/vended = new R.product_path(get_turf(src))
- if(usr.put_in_hands(vended))
- to_chat(usr, "You take [R.name] out of the slot.")
+ if(usr.CanReach(src))
+ if(usr.put_in_hands(vended))
+ to_chat(usr, "You take [R.name] out of the slot.")
+ else
+ to_chat(usr, "[capitalize(R.name)] falls onto the floor!")
else
- to_chat(usr, "[capitalize(R.name)] falls onto the floor!")
+ to_chat(usr, "[capitalize(R.name)] falls onto the floor!")
SSblackbox.record_feedback("nested tally", "vending_machine_usage", 1, list("[type]", "[R.product_path]"))
vend_ready = 1