mob
proc
saveproc()
if(src.cansave)
if(src.contents.len>=1)
var/keys=src.key
var/savefile/save
save = new("playerswwa/[keys]/[src.name]")
save["mob"] << src
save["x"] << src.x
save["y"] << src.y
save["z"] << src.z
mob
proc
load()
if(!src)
return
var/keys=src.key
var/list/saveFiles=src.get_char_list()
if(!src.count_chars())
return
var/choice=input("Welcome to (game name)! Who do you want to load?\n\n\
\n\nSavefiles Used: [src.count_chars()]/3","Login")as null|anything in saveFiles
if(fexists("playerswwa/[keys]/[choice]"))
var/savefile/load
load = new ("playerswwa/[keys]/[choice]")
load["mob"] >> usr
load["x"] >> usr.x
load["y"] >> usr.y
load["z"] >> usr.z
//rest of load proc
client
Del()
if(src.banned)
return..()
if(!src.mob)
return..()
else
if(!src.banned)
if(!src.mob.toofull)
if(src.key!="Critical172")
world << output("<b><font color = white>Info:<font color = blue> [src.mob]([src]) has logged off!","output")
maxplayers-=1
if(src.mob.toofull)
src.mob<<output("<b><font color = white>Info:<font color = blue> Server Full!","output")
for(var/obj/M in world)
if(M.owner == src.mob)
del M
for(var/mob/M in world)
if(M.owner == src.mob)
del M
//lots of stuff right here to take the player out of various events
src.mob.saveproc()
del(mob)
return..()
client
New()
if(src.key == "")
del src
..()
if(src.key in bannedkeys)
del src
if(src.address in bannedips)
del src
if(maxplayers>80)
if(src.key != "Critical172"&&src.key != "Chev45"&&src.key != "Young money 214"&&src.key != "Zagros5000")
src.mob.toofull=1
del src
return
maxplayers+=1
//the rest of the hud being loaded
Problem description:
Somehow clones are randomly being made when people relog. It doesn't happen a lot, but when they log out then log back in there will be a copy of their character as if it didn't delete after the player logged out and will result in a rollback after reboots. I'm not sure if it's something with the saveproc or logging out. How does that even happen and how do you fix that?