Allo all, so as usual ive been tweaking things and ive been doing some debugging with some mates on my game and some times it required logging out and since i didn't have any form of deleting in the actual logout the mobs always just stayed there. so i decided it go and pull up the logout/deathavoid code someone asked about awhile ago and pull it into play for my needs.
The following code as you will be able to see when posted below will on client/del save the player as a check and then create a new datum called logoutter this is just a simple datum that watches over the player mob until the time for deletion comes. anyway onto the code.
First up we have the datum and client/del
mob.key = null
src.tag = "logoutter |[p.ckey]|[p.name]|"
reffer = p
world << "0.[reffer] = [reffer.x] - [reffer.y] - [reffer.z]"
world << "1.[reffer] = [reffer.x] - [reffer.y] - [reffer.z]"
reffer.key = c.key
world << "2.[reffer] = [reffer.x] - [reffer.y] - [reffer.z]"
world << "[P] has Successfully logged out."
next up is the load and other stuff.
var/savefile/F = new(savedir)
var/logoutter/loutter = locate("logoutter |[src.ckey]|[playername]|")
src << "System: You have reconnected to your mob."
F["/Slot[playerslot]"] >> src.mob
world << "[src.mob]/[ckey] has Logged into the world"
Now im unsure if its clear in there in any case what is happening is when the mob regains a client it is meant to stay in the same location. instead it gets hurled back to the first available tile and im unsure why this is the case.
I have looked over most of my code and i cant seem to figure out why this is occuring.
If anyone has insight onto this or ways to improve this it would be greatly appreciated.