Thread Rating:
  • 3 Vote(s) - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Feature] Restocking Vending machines
#2
I don't think the all-purpose refill unit would be compatible with any vending machine right now since you don't have any code to handle the special situation where W:vendingType is "all".

Also, just a suggestion based on what I've been told and have experienced while making patches.

You might want to change

Code:
    if (istype(W, /obj/item/vending/restock_cartridge))
        //check if cartridge type matches the vending machine
        if (istype(src, text2path("/obj/machinery/vending/[W:vendingType]")))

to something like

Code:
    if (istype(W, /obj/item/vending/restock_cartridge))
        //check if cartridge type matches the vending machine
        var/obj/item/vending/restock_cartridge/Q = W
        if (istype(src, text2path("/obj/machinery/vending/[Q.vendingType]")))

Or something along those lines.

In general, avoid using : unless you absolutely have to.
Reply


Messages In This Thread
RE: [Feature] Restocking Vending machines - by Noah Buttes - 05-29-2018, 05:46 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)