ID:2170006
 
(See the best response by Lummox JR.)
Code:
contents+=new/obj/Items/Sword

//Error displayed - cannot append to list


Problem description:
Why do I get this error?
I need more context here. However, the better syntax by far would be new/obj/Items/Sword(src).
In response to Lummox JR
Its a simple starter item for directly after you've created a character, and after fiddling around for a bit i came up with the same solution as you, however, every time an object is picked up using the get() verb, after saving then restarting dream seeker and loading the savefile, i get the same error and the contents of the character is wiped (no items, or skills)

obj
Items
verb
Get()
set src in view(1,usr)
if(scatter)
return
if(cash)
for(var/obj/Items/money/m in usr.contents)
usr.money+=amt
view()<<"<font color=yellow><i>[usr] has picked up [amt] money"
del src
else
loc=usr
I'm confused, because I'm not seeing that line of code in this verb.
That's because I changed it to loc=usr when I was fiddling around during testing, but the error would still occur occasionally, albeit not all the time. Before it was :
usr.contents.Add(src)
In response to Lummox JR
Ah, the cause was old save files from before it was changed. Well then..., since up to now this was a waste of your time, let me ask you something else that I've been wondering about. What is:
.=..()
Best response
. = ..() means to call the parent proc, and use its value as the default return value.

If you override a proc, like for instance obj/item/Click(), then ..() will call the parent--which might be obj/Click() or atom/Click() or so on. (You can override the very same proc more than once and one will be the parent to the other, but that's usually a bad idea.)

The . var is the default value for return; it starts out as null.

Where you often see . = ..() is in procs like Move(), where the return value matters. When you call the parent, you often want to use the value it returned, but still do other work first. For instance:

mob/Move(newloc, newdir)
if(!dead) return
. = ..()
if(.)
TookStep()

This calls the default Move() if the mob isn't dead, but if the move succeeded, it also calls a proc called TookStep() that might do additional housekeeping.