diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 4f7502bb02..e27431f8ee 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -579,39 +579,36 @@ GLOBAL_LIST_EMPTY(vending_products) if(!R || !istype(R) || !R.product_path) vend_ready = TRUE return + if(R.amount <= 0) + to_chat(usr, "Sold out.") + vend_ready = TRUE + return if(R in hidden_records) if(!extended_inventory) vend_ready = TRUE return else if(R in coin_records) - if(!(coin)) - to_chat(usr, "You need to a coin to get this item!") + if(!coin) + to_chat(usr, "You need to insert a coin to get this item!") vend_ready = TRUE return if(coin && coin.string_attached) - if(!prob(50)) - to_chat(usr, "You weren't able to pull [coin] out fast enough, the machine ate it, string and all!") - QDEL_NULL(coin) - return - if(!usr.CanReach(src)) - to_chat(usr, "You successfully pull [coin] out of [src] to the floor.") - coin = null - if(!usr.put_in_hands(coin)) + if(prob(50)) + 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) - to_chat(usr, "You successfully pull [coin] out before [src] could swallow it.") - coin = null - QDEL_NULL(coin) + else + to_chat(usr, "You weren't able to pull [coin] out fast enough, the machine ate it, string and all!") + QDEL_NULL(coin) + else + QDEL_NULL(coin) else if(!(R in product_records)) vend_ready = TRUE message_admins("Vending machine exploit attempted by [ADMIN_LOOKUPFLW(usr)]!") return - if(R.amount <= 0) - to_chat(usr, "Sold out.") - vend_ready = TRUE - return - else - R.amount-- if(((last_reply + 200) <= world.time) && vend_reply) speak(vend_reply) last_reply = world.time @@ -623,8 +620,7 @@ GLOBAL_LIST_EMPTY(vending_products) to_chat(usr, "You take [R.name] out of the slot.") else to_chat(usr, "[capitalize(R.name)] falls onto the floor!") - - + R.amount-- SSblackbox.record_feedback("nested tally", "vending_machine_usage", 1, list("[type]", "[R.product_path]")) vend_ready = TRUE return