mob
proc
DeleteCharacter()
if(src.client)
alert("WARNING: Your about to select a character to delete.")
var/list/characters=new/list()
var/savefile/F=new("Saves/Index/[copytext(src.ckey,1,2)]/[src.ckey].sav")
F["Characters"]>>characters
var/CancelCharacterDeletion = "Cancel"
var/list/menu = new()
menu += CancelCharacterDeletion
menu += characters
var/result = input("Delete character", "DELETE") in menu
if(result)
characters-=result
F=new("Saves/Index/[copytext(src.ckey,1,2)]/[src.ckey].sav")
F["Characters"]<<characters
if(fexists("Saves/[copytext(ckey(result),1,2)]/[ckey(result)].sav"))
fdel("Saves/[copytext(ckey(result),1,2)]/[ckey(result)].sav")
Problem description:
The deleting of the savefiles in itself works great, however, it won't let me remove the savename from the list of savefiles. the savefile is deleted but the reference is not.
Now what i thought would happen here, is that when i've chosen a save to delete(result), i remove result from characters and then write it back to F["Characters"](hoping that it will overwrite the original content). however it doesn't seem to happen that way, as all references are still there.
Anyone got any clues as to how i might fix this?
The lines in question
Not sure the sleep is neccesary.