mob/proc/UpdateInventory()
var/items = 0
for(var/obj/O in src)
winset(src,"Inventory.Grid","current-cell=[++items]")
src<<output(O,"Inventory.Grid")
winset(src, "Inventory.Grid","cells=[items]")
obj/Items
var/slot
verb
Get()
set src in oview(1)
Move(usr)
if(Amount)
usr<<"You picked up [Amount] [src]\s"
else usr<<"You picked up \a [src]"
usr.UpdateInventory()
Drop()
var/amt = input(usr,"How many would you like to drop?\nYou have [src.Amount] [src]\s","Drop",src.Amount) as num
amt = min(amt,src.Amount)
if(amt<=0 || !amt) return
if(src.Amount<=0) del(src)
var/new_amt = max(src.Amount,src.Amount-amt)
if(new_amt<=0)
src.loc = usr.loc
usr.UpdateInventory()
return ..()
src.Amount = new_amt
var/obj/Items/B = src.type
B = new B(usr.loc)
B.Amount = amt
if(src.Amount<=1)
src.suffix = null
else
src.suffix = "([src.Amount])"
usr.UpdateInventory()
return
Problem description:
runtime error: type mismatch: cannot compare 0 to Tin Ore (/obj/Items/Ores/Tin_Ore)
proc name: Drop (/obj/Items/verb/Drop)
source file: Objects.dm,53
usr: Wolf (/mob)
src: Tin Ore (/obj/Items/Ores/Tin_Ore)
call stack:
Tin Ore (/obj/Items/Ores/Tin_Ore): Drop()
EDIT
Fixed the line that had the max() problem
You're trying to find what's bigger numerically, the src or a number. You just can't do that, it would be like saying if the word "who" is greater than a table.