ID:169918
 
Can someone fix this login its driving me insane!
mob
loginchar
Login()
begin
switch(input("What would you like to do?","Login")in list("Continue","New Game"))
if("New Game")
var/mob/player/newmob=new
switch(input("What race would you like to be?","Race")in list("Twin Blade","Long Blade","Wave Master"))
if("Twin Blade")
newmob.icon = 'Kite.dmi'
if("Long Blade")
newmob.icon = 'Bear.dmi'
if("Wave Master")
newmob.icon = 'Elk.dmi'
name
var/n = input("[usr.key]","Name")as text
if(n == "")
goto(name)
else
newmob.name = n
usr.froze = 1
usr.loc = locate(11,4,1)
usr.icon_state = "Gone"
flick("Return",usr)
sleep(5)
view() << sound('gateout.wav',0)
sleep(20)
usr.froze = 0
usr << sound('foreigners.mid',1)
del(src)
if("Continue")
var/Cancel = "Cancel"
var/list/characters = src.CharacterList()
var/list/menu = new()
menu += characters
menu += Cancel
var/result = input("Load which charachter?") in menu
var/success = src.client.LoadMob(result)
if (result == Cancel)
goto begin

if (success)
del(src)

mob
proc
CharacterList()
var/savefile/F = new("world.sav")
F.cd = "/[ckey]"
var/list/characters = F.dir
return characters

mob/player
var/newbie = 1
Login()
if(src.newbie == 1)
src.newbie = 0
src.client.SaveMob()
Logout()
world << "[src] has left."
del(src)

mob/verb/Save()
src.client.SaveMob()

mob
Write(savefile/F)
..()

F["Verbs"] << verbs

Read(savefile/F)
..()

var/list/verbe
F["Verbs"] >> verbe
for(var/verb/V in verbe)
verbs+=V

client/proc/SaveMob()
var/char_ckey = cKey(src.mob.name)
var/savefile/F = new("world.sav")
src.mob.LastX=src.mob.x
src.mob.LastY=src.mob.y
src.mob.LastZ=src.mob.z
F["/[ckey]/[char_ckey]"] << src.mob


client/proc/LoadMob(char_ckey)
var/mob/new_mob
var/savefile/F = new("world.sav")
F["/[ckey]/[char_ckey]"] >> new_mob
if (!new_mob)
return 0
else
new_mob.loc=locate(new_mob.LastX,new_mob.LastY,new_mob.LastZ)

mob = /mob/loginchar

Thats all you need I think!
Uh...what's the problem?
1. What is the problem?
2. I'm not sure if you included this, but if you did I didn't see it- use the ..() proc at the end of Login()
Your use of goto is completely bogus in this code. Replace it with a while() loop and continue statements, which are correct. After that it'll be much easier to diagnose the problem, once you tell us what it is of course.

Lummox JR