ID:1754252
 
(See the best response by Kaiochao.)
Code:
Saving and Loading Code:
mob/proc/LoadFile()
var/savefile/F = new("Save Files/[ckey].sav")
ClearPlayer(src)
Read(F)
src.loc = locate(src.saved_x,src.saved_y,src.saved_z)
if(src.z == 0)
src.loc = locate(1,1,1)
for(var/obj/deck/A in usr.saved_decks)
A.loc = src

for(var/obj/specialCards/A in src.saved_spec_cards)
A.loc = src

mob/proc/SaveFile()
var/savefile/F = new("Save Files/[ckey].sav")
for(var/obj/deck/A in src)
saved_decks += A
continue

for(var/obj/specialCards/A in src)
saved_spec_cards += A
continue

src.saved_x = src.x
src.saved_y = src.y
src.saved_z = src.z

Write(F)
src << "Saved!"


Error that pops up randomly:
runtime error: cannot append to list
proc name: LoadFile (/mob/proc/LoadFile)
usr: DevDuelist (/mob)
src: DevDuelist (/mob)
call stack:
DevDuelist (/mob): LoadFile()
DevDuelist (/mob): Login()


Problem description:
This doesn't happen all the time but I was to curious when this does happen. On a random occurence after running the LoadFile Command, it will come up with this error and stop that code all together and doesn't load the info on that save file.
why do you have continue in your for loops lol.
Best response
It's been a while, but I think this happens when you try to load an object type that no longer exists. For example, you have a card, save, log out. You remove the card in the code. You login, but loading tries to load a card that doesn't exist in the game, so loading crashes with that error.

I could be wrong!
So I changed the dueling variables to a tmp variable and it seems to not come up with the error anymore O.o. But I am unsure if this will change anything.

EDIT: I do not want them saved so the savefile if you are asking :).