Skip to content

Commit

Permalink
Fixes the smartfridge.dm properly
Browse files Browse the repository at this point in the history
  • Loading branch information
blah authored and blah committed Nov 6, 2015
1 parent 396fc81 commit ea4bdc9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
22 changes: 12 additions & 10 deletions code/modules/food&drinks/kitchen machinery/smartfridge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
S.remove_from_storage(O,src)

O.loc = src
var/n = O.name
var/n ="\ref[O]"

if(item_quants[n])
item_quants[n]++
Expand Down Expand Up @@ -168,18 +168,19 @@
for (var/O in item_quants)
if(item_quants[O] > 0)
var/N = item_quants[O]
var/itemName = sanitize(O)
dat += "<FONT color = 'blue'><B>[capitalize(O)]</B>:"
var/obj/item/item = locate(O)
var/obj/item/itemName = sanitize(item.name)
dat += "<FONT color = 'blue'><B>[capitalize(itemName)]</B>:"
dat += " [N] </font>"
dat += "<a href='byond://?src=\ref[src];vend=\ref[N];amount=1'>Vend</A> "
dat += "<a href='byond://?src=\ref[src];vend=[O];amount=1'>Vend</A> "
if(N > 5)
dat += "(<a href='byond://?src=\ref[src];vend=\ref[itemName];amount=5'>x5</A>)"
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=5'>x5</A>)"
if(N > 10)
dat += "(<a href='byond://?src=\ref[src];vend=\ref[itemName];amount=10'>x10</A>)"
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=10'>x10</A>)"
if(N > 25)
dat += "(<a href='byond://?src=\ref[src];vend=\ref[itemName];amount=25'>x25</A>)"
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=25'>x25</A>)"
if(N > 1)
dat += "(<a href='?src=\ref[src];vend=\ref[itemName];amount=[N]'>All</A>)"
dat += "(<a href='?src=\ref[src];vend=\ref[O];amount=[N]'>All</A>)"

dat += "<br>"

Expand All @@ -193,7 +194,8 @@
return
usr.set_machine(src)

var/N = locate(href_list["vend"])
var/N = href_list["vend"]
usr << N
var/amount = text2num(href_list["amount"])

if(item_quants[N] <= 0) // Sanity check, there are probably ways to press the button when it shouldn't be possible.
Expand All @@ -203,7 +205,7 @@

var/i = amount
for(var/obj/O in contents)
if(O.name == N)
if(locate(N) == O)
O.loc = src.loc
i--
if(i <= 0)
Expand Down
1 change: 1 addition & 0 deletions data/mode.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extended

0 comments on commit ea4bdc9

Please sign in to comment.