ID:139625
 
Code:
mob/var/cansave=0
mob/proc/SaveChar()
if(usr.cansave==0)
return
var/savefile/F = new ("Players/[src.ckey].sav")
F["x"]<<src.x
F["y"]<<src.y
F["z"]<<src.z
Write(F)

client/Del()
world<<"<B><I>[usr] has logged out!"
src.mob.SaveChar()
spawn()del(src)

mob/proc/Load()
if(fexists("Players/[src.ckey].sav"))
winset(src,"Main","is-maximized=true")
winset(src,"Login","is-visible=false")
var/savefile/F = new("Players/[src.ckey].sav")
F["x"]>>src.x
F["y"]>>src.y
F["z"]>>src.z
Read(F)
src.loggingin=0
src.cansave=1
world<<"<B><I>[src] has logged in!"
src<<"<center>-Message of the Day!-<br>[MOTD]<br>---"
src.Links()
else
winset(src,"Login","is-visible=true")//Dun fuk wiff that kind of stuff xD LOLxDD client new to load?
..()


Problem description:
Well it saves the loc once, you log in your in that spot, then you log out again and log in, your in the same y, but a different x, odd right? because everything was stated correctly.(the cansave works perfectly fine before people start saying that may be causing the problem =P)
client
proc
Save()
var/savefile/F = new("[ckey].sav")
F["mob"] << mob
// Do not add anything more to be saved here
Load()
if(fexists("[ckey].sav"))
var/savefile/F = new("[ckey].sav")
F["mob"] >> mob
// Do not add anything more to be loaded here

mob
Write(var/savefile/F)
..()
// Add any special processing for saving here
F["x"] << x
F["y"] << y
F["z"] << z
Read(var/savefile/F)
..()
// Add any special processing for loading here
loc = locate(F["x"], F["y"], F["z"])
Iocamus wrote:
client/Del()
world<<"<B><I>[usr] has logged out!"
src.mob.SaveChar()
spawn()del(src)


Jegus, no. Do not put del(src) inside Del(). What you want is just "..()". And get rid of the spawn() too.

Fortunately there's logic in place to prevent such a profoundly stupid error from actually doing anything. If there weren't, though, deleting a client would have resulted in an infinite loop.