ID:273066
 
Is there a problem in saving a mob's datum that holds reference to other players ?

Example (if I wasn't clear enough)

mob/var/guild/guild

guild
var/list/members = list()
Proc/Invite(mob/M)
members += M
M.guild = src
If you have any /mob reference saved then that'll potentially cause issues (such as roll-backs).

It would be better if you have a list() saving the mob name/key combo (ex: list("key"="name")) and a /mob reference to the guild being a var/tmp/ to avoid the problem mentioned previously (/tmp makes that variable unsavable with Write()).

Ex:
var
tmp/list/members=list() // List containing mob reference, /tmp making it unsavable to avoid problems.
list/member_list=list() // list("key"="name")


proc/Invite(mob/M)
if(!(ismob(M) && M.client)) // If not a client
return 0
...
Guild.members += M
Guild.member_list[M.key] = M.name


mob/Login()
..()
if((src.key in Guild.member_list) && (Guild.member_list[src.key] == src.name))
src << "Welcome back to the [Guild.name]!"
Guild.members += src

mob/Logout()
...
if(src in Guild.members)
Guild.members -= src
In response to GhostAnime (#1)
Alrighty, didn't want any rollbacks to happen so I asked just to be sure.

Thanks :)