ID:272676
 
Made a verb for testing that calls that proc, however it won't output the object like it's supposed to..


mob/proc/UpdateInventory()
//this is here just for testing purposes
var/obj/equippable/sword/L = new()
L.Move(src)


var/row=1
for(var/obj/equippable/A in contents)
src << output(A,"invgrid:1,[row++]")


How do I fix it? I want every object in my inventory to be outputted to the grid.

[EDIT]

*Suspecting that contents only saves a reference of the object added to it and not the object*
^ If it IS like that, an alternative would be a list that saved the actual items right?
Any time you set a var to an object you're always working with a reference, so this is no different. I suspect the issue is a problem with your skin and not (directly) the code.

Lummox JR
In response to Lummox JR (#1)
How would it be a problem with my skin ? What could possibly affect it ?

On the grid appears "sword" however I want the actual object there. That's the problem with the 'reference', I guess.
In response to Andre-g1 (#2)
Did you check the "is a flexible list of entries" box in the interface editor?
In response to Jeff8500 (#3)
Yes. But that just makes it go horizontally, and then skip to another row if there's no more space(I think) though, and wouldn't affect an output much further than that.
Fixed, the problem itself had nothing to do with neither the skin or with that snippet. The problem was somewhere else.