ID:1702400
 
BYOND Version:507
Operating System:Windows 7 Ultimate
Web Browser:Firefox 32.0
Applies to:Dream Seeker/Webclient
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
Creating an object and saving it to a savefile will write the object reference twice independently rather than writing it once and referencing the object from other areas.

Numbered Steps to Reproduce Problem:
1: Create an object and optionally set at least one variable.
2: Create a /savefile Object and save the object to two separate buffers
3: Load the object from the savefile after saving it.
4: Compare the object references to see if they are equal.

Code Snippet (if applicable) to Reproduce Problem:
proc/thing_test_save()
var obj/O = new
O.name = "Carl"
var savefile/F = new("Test Save.sav")
F["location_1"] << O
F["location_2"] << O
proc/test_thing_load()
var obj/O1
var obj/O2
var savefile/F = new("Test Save.sav")
F["location_1"] >> O1
F["location_2"] >> O2
src << O1
src << O2
if(O1==O2)
src << "The object references are the same."
else
src << "The object references are different."


Test Project

Expected Results: Duplicate References handled as they normally are

Actual Results: Duplicate References are stored as separate objects

Does the problem occur:
Every time? Or how often? Every Time
In other games? Yes
In other user accounts? Yes
On other computers? Haven't Tested

When does the problem NOT occur?
When running a project compiled before 507.1260

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
507.1259 and earlier

Workarounds:

Compile in 507.1259 or: Create Separate Buffers in the savefile to load the duplicate references manually. Depending on the method for this second approach, this can render older savefiles incompatible.
I'm not completely sure if the problem is caused by compiling on my computer, since it's been having several issues with compilation that I don't get on other systems (I don't understand why, however)
I've tested this problem as well and gotten the same result as Pokemonred200 did.
I'm a little confused here because the savefile code hasn't been changed at all. Furthermore the minor build used to compile shouldn't impact the results; only the server version should have any relevance. The compiler hasn't changed one bit between those builds; the .dmb files generated by 507.1259 and by 507.1261 should be identical. Are you certain you tested the same thing in both versions, or was 507.1259 simply the version you used back when things behaved differently?

One thing I should mention however is that I'm not sure this method of loading will ever confirm for you if the savefile has different references. What will confirm it is exporting to text. When you load the objs independently in two separate lines, I think it's going to create a new obj each time. That would be very different from, say, loading a mob that had a couple of lists sharing the same obj.