In response to Garthor
Garthor wrote:
This one goes up there with the abuse of usr: it USUALLY works, but then breaks under certain not-too-uncommon circumstances.

A very bad comparison. usr breaks quite commonly, but what you're comparing it to here isn't something that breaks at all, and certainly not produces 'garbled' or malformed results or doesn't work as you've claimed; it works, and works fine, as expected.

When using Write(), it does not save a full object, and so when it comes to the reference to the mob, there's no previous reference in the savefile and so it creates a new one.

And even if so, there is no problem with this - there is a good reason for that and it's just the saving doing its job.
In response to Kaioken
I already explained what the problem for that is: it results in two copies of the mob's data being saved, and it results in Read() creating a new mob when it reads that reference, instead of the intended behavior of loading the variables.

Oh, and I just tested this a bit more, and it actually causes a "cannot append to list" error message:

obj/thing
var/mob/owner

mob
New()
..()
var/obj/thing/T = new(src)
T.owner = src

verb/test()
var/savefile/F = new()
Write(F)
src << F.ExportText()
Read(F)


Not sure exactly why... I think it's because it's getting caught up about the same object being in two separate contents lists.
Page: 1 2