ID:149447
 
I have a save/load system that works, but the new erase command screws everything up. Let A, B, C, and D be 4 mobs created by the user; all can be loaded successfully and are listed when asked which char to load.

If you erase A and hit erase again, it says you can only erase B, C, and D; same with load (can only load B, C, and D). This is how it should be.

Then, if you log out and log back in, if you hit erase, A, B, C, and D are all listed (even when A was erased). If you choose one besides A, it is deleted as it should be, but if you choose A, runtime errors result. If you continue A, the same thing happens, but you can load B, C, and D just fine. Why is it not saving the list after logout? It's not even mentioned in the logout() proc.




for(var/temp_start = 1, temp_start, )
switch(input("","",) in list("New Game","Continue","Erase"))
if("New Game") temp_start = 0
if("Continue")
if(fexists("players/[src.client.ckey]/index/char_list.sav"))
var/list/temp = list()
var/savefile/G = new ("players/[src.client.ckey]/index/char_list.sav")
G["index"] >> temp
var/select_char = (input("Which character would you like to load?","Character Selection",) in temp)
var/savefile/F = new ("players/[src.client.ckey]/[select_char].sav")
F["mob"] >> src
load_char(src)
return
else
src << "You do not have any characters to load."
if("Erase")
if(fexists("players/[src.client.ckey]/index/char_list.sav"))
var/list/temp = list()
var/savefile/G = new ("players/[src.client.ckey]/index/char_list.sav")
G["index"] >> temp
var/select_char = (input("Which character would you like to delete?","Character Selection",) in temp)
temp -= select_char
master_name_list -= select_char //other players can use charname
var/savefile/F = new ("players/[src.client.ckey]/index/char_list.sav")
F["index"] << temp
if(!temp.len) fdel("players/[src.client.ckey]")
else
src << "You do not have any characters to erase."
thats to much code for me to just look at and tell you whats wrong, but im sure someone can help if they look at it.