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.