obj/item
var
canDye = 0
vairies = 0
stack = 0
stackable = 0
onFloor = 0
wealth
stackable = 1
name = "Gold"
icon = 'wealth.dmi'
icon_state = "tens"
mob/proc
addItem(obj/item/i)
if(i.stackable && i.stack > -1)
var/obj/item/z = locate(i.type) in src
if(z)
z.stack += i.stack
if(istype(i, /obj/item/wealth))wealth(z)
del i
return
i.Move(src)
if(istype(i, /obj/item/wealth))wealth(i)
wealth(obj/item/i)
if(istype(i, /obj/item/wealth))
if(i.stack < 1000) i.icon_state = "tens"
else if(i.stack >= 1000 && i.stack < 10000) i.icon_state = "1k"
else if(i.stack >= 10000 && i.stack < 100000)i.icon_state = "10k"
else if(i.stack >= 100000 && i.stack < 1000000)i.icon_state = "100k"
else i.icon_state = "1m"
i.suffix = "x[Comma(i.stack)]"
bank(obj/item/i)
if(i.stackable && i.stack > -1)
var/t = input("How many [i] do you wish to deposit","Deposit") as num|null
if(t < 1 || t == null) src << "<b>Info:</b> You deposited nothing."
else if(t > i.stack) src << "<b>Info:</b> You don't have that much of [i]."
else
i.stack -= t
if(i in bank)
i.stack += t
src << "happpening"
else bank.Add(i)
if(i.stack < 1) contents.Remove(i)
else bank.Add(i)
bankUpdate()
bankUpdate(var/i = 0)
set background = 1
if(banking)
winset(src,"miscGrid",null)
for(var/obj/item/t in bank)
if(istype(t, /obj/item/wealth)) wealth(t)
src << "[t]: [t.stack]"
src << output(t, "miscGrid:[++i]")
winset(src, "miscGrid", {"cells = "1x[i]""})
Problem description: It's probably an easy fix but I just can't seem to get it to work. I am trying to add a stackable object into a list.