client/New() if(fexists("players/[ckey].sav")) switch(alert(src,"You have a savefile. Would you like to load it, or delete it?",world.name,"Load","Delete","Cancel")) if("Load") var/mob/M var/savefile/F=new("players/[ckey].sav") F>>M mob=M if("Cancel") return
if(!mob) //new character var/n=input(src,"Please input a name for your character.") as null|text if(n==null) return//clicked cancel: disconnect from the server //TODO: locate any letters within the string. if none are found, reject it n=html_encode(n) //strip HTML //TODO: strip \n and \t characters from the name mob=new/mob/player mob.name=n return mob
The reason I use client/New() is because I don't have to assign a mob until the player has been through character handling. Just as long as client/New() doesn't return while client.mob is null it will work.
The reason I use client/New() is because I don't have to assign a mob until the player has been through character handling. Just as long as client/New() doesn't return while client.mob is null it will work.