ID:264756
 
Code:
    New()
..()
if(fexists("Kages.sav"))
var/savefile/F = new ("Kages.sav")
F >> SavedKages
CurrentKages=new/list
CurrentKages=SavedKages
Del()
return ..()
var/savefile/F = new("Kages.sav")
SavedKages=new/list
SavedKages=CurrentKages
F << SavedKages


Problem description:
I want it so that list (which is an associative list containing text (e.g. KagesList["saucepanman"]="Leaf")) to simply save itself as is on world.Del(), and restore itself on world.New()

Unfortunately the list doesnt seem to survive the journey.

In your Del() code you're calling ..() before anything else, which will delete the world without letting the rest of the proc be called, but you're also using the return statement, guaranteeing the rest of the proc won't be called.

I should also point out that setting a var to new/list and then setting it to another list won't really accomplish anything; you're creating a list and immediately destroying it again, not copying the one list into the other. If you want a true copy you should use the list.Copy() proc.

Lummox JR
In response to Lummox JR
Heh, thanks again lummox. didnt notice that.
I was sure I had it the first time too. Thought I was going crazy.