Login()
usr.verbs -= typesof(/mob/verb/)
usr.density = 1
usr.canbuild=0
usr<<"Welcome to [world.name]!"
inpat
switch(input("What do you want to do?")in list("Make new character", "Continue with old character"))
if("Make new character")
switch(input("Are you sure? If you have an old character, it will be erased.")in list("Yes", "No"))
if("No")
goto inpat
if("Yes")
var/savefile/E = (ckey)
del(E)
var/savefile/F = new(ckey)
Read(F)
usr.name=(null)
Problem description:
It seems that calling Del(E) to delete the previous save file doesn't work. I'm sure I'm just using this wrong. I'd appreciate some clarity on this situation. This is the runtime error I recieve when trying create a new character:
runtime error: bad del
proc name: Login (/mob/Login)
usr: the character (/mob/character)
src: the character (/mob/character)
call stack:
the character (/mob/character): Login()
On an unrelated note with your code, usr isn't totally safe to use in Login() procedures, so you might want to think about changing that.