diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 3fe719c9f2..bffa2a997b 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -53,6 +53,7 @@ var/extended_inventory = 0 //can we access the hidden inventory? var/scan_id = 1 var/obj/item/weapon/coin/coin + var/obj/item/stack/spacecash/bill var/dish_quants = list() //used by the snack machine's custom compartment to count dishes. @@ -118,10 +119,9 @@ ..() /obj/machinery/vending/Destroy() - qdel(wires) - wires = null - qdel(coin) - coin = null + QDEL_NULL(wires) + QDEL_NULL(coin) + QDEL_NULL(bill) return ..() /obj/machinery/vending/snack/Destroy() @@ -311,6 +311,12 @@ attack_hand(user) return else if(istype(W, /obj/item/weapon/coin)) + if(coin) + to_chat(user, "[src] already has [coin] inserted") + return + if(bill) + to_chat(user, "[src] already has [bill] inserted") + return if(!premium.len) to_chat(user, "[src] doesn't have a coin slot.") return @@ -320,6 +326,21 @@ coin = W to_chat(user, "You insert [W] into [src].") return + else if(istype(W, /obj/item/stack/spacecash)) + if(coin) + to_chat(user, "[src] already has [coin] inserted") + return + if(bill) + to_chat(user, "[src] already has [bill] inserted") + return + var/obj/item/stack/S = W + if(!premium.len) + to_chat(user, "[src] doesn't have a bill slot.") + return + S.use(1) + bill = new S.type(src,1) + to_chat(user, "You insert [W] into [src].") + return else if(istype(W, refill_canister) && refill_canister != null) if(stat & (BROKEN|NOPOWER)) to_chat(user, "It does nothing.") @@ -386,9 +407,9 @@ var/list/display_records = product_records if(extended_inventory) display_records = product_records + hidden_records - if(coin) + if(coin || bill) display_records = product_records + coin_records - if(coin && extended_inventory) + if((coin || bill) && extended_inventory) display_records = product_records + hidden_records + coin_records dat += "" dat += "" if(premium.len > 0) - dat += "Coin slot: " - if (coin) - dat += "[coin]  Remove" + dat += "Change Return: " + if (coin || bill) + dat += "[(coin ? coin : "")][(bill ? bill : "")]  Remove" else - dat += "No coin  Remove" + dat += "No money  Remove" if(istype(src, /obj/machinery/vending/snack)) dat += "

Chef's Food Selection

" dat += "
" @@ -443,16 +464,24 @@ return if(href_list["remove_coin"]) - if(!coin) - to_chat(usr, "There is no coin in this machine.") + if(!(coin || bill)) + to_chat(usr, "There is no money in this machine.") return - - coin.loc = loc - if(!usr.get_active_held_item()) - usr.put_in_hands(coin) - to_chat(usr, "You remove [coin] from [src].") - coin = null - + if(coin) + if(!usr.get_active_held_item()) + usr.put_in_hands(coin) + else + coin.forceMove(get_turf(src)) + to_chat(usr, "You remove [coin] from [src].") + coin = null + if(bill) + if(!usr.get_active_held_item()) + usr.put_in_hands(bill) + else + bill.forceMove(get_turf(src)) + to_chat(usr, "You remove [bill] from [src].") + bill = null + usr.set_machine(src) @@ -494,26 +523,25 @@ vend_ready = 1 return else if(R in coin_records) - if(!coin) - to_chat(usr, "You need to insert a coin to get this item!") + if(!(coin || bill)) + to_chat(usr, "You need to insert money to get this item!") vend_ready = 1 return - if(coin.string_attached) + 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 else to_chat(usr, "You couldn't pull [coin] out because your hands are full!") - qdel(coin) - 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(coin) - coin = null + QDEL_NULL(coin) else - qdel(coin) - coin = null + QDEL_NULL(coin) + QDEL_NULL(bill) + else if (!(R in product_records)) vend_ready = 1 message_admins("Vending machine exploit attempted by [key_name(usr, usr.client)]!") diff --git a/tgstation.dme.rej b/tgstation.dme.rej new file mode 100644 index 0000000000..f8575768ad --- /dev/null +++ b/tgstation.dme.rej @@ -0,0 +1,9 @@ +diff a/tgstation.dme b/tgstation.dme (rejected hunks) +@@ -1383,6 +1383,7 @@ + #include "code\modules\hydroponics\grown\misc.dm" + #include "code\modules\hydroponics\grown\mushrooms.dm" + #include "code\modules\hydroponics\grown\nettle.dm" ++#include "code\modules\hydroponics\grown\onion.dm" + #include "code\modules\hydroponics\grown\potato.dm" + #include "code\modules\hydroponics\grown\pumpkin.dm" + #include "code\modules\hydroponics\grown\random.dm"