ID:91690
 
BYOND Version:462
Operating System:Windows 7 Pro 64-bit
Web Browser:Firefox 3.5.7
Status: Deferred

This issue may be low priority or very difficult to fix, and has been put on the back burner for the time being.
Descriptive Problem Summary:
appearance objects in savefiles are not properly saving (or loading) all information associated with them. This is the root cause of "sticky" overlays which cannot be removed after being saved and loaded.

The issue - as far as I can tell - seems to be that the name and the mouse_*_pointer variables are not quite saved properly. The name is not saved/loaded at all, and the mouse_*_pointer variables do not seem to be initialized to their initial values when there is no data in the savefile.

In other words, when it does not save anything in the file for mouse_drop_pointer as it is unchanged from its initial value of 1, upon loading it does not initialize the value to 1 again, but instead it remains null.

Numbered Steps to Reproduce Problem:
1) Add X to O's overlays.
2) Save O.
3) Load O.
4) Attempt to remove X from O's overlays.

Code Snippet (if applicable) to Reproduce Problem:
mob/verb/test()
//create O, add some overlay to it
var/obj/O = new()
var/obj/lay = new()
lay.icon = 'overlay.dmi'
//we may change lay.mouse_drop_pointer to any non-initial value here as well to get it to save properly, instead of setting it to null later
//however, doing the same for name will not work, as name does not seem to be saved at all
O.overlays += lay

//save O, load it into loaded
var/obj/loaded
var/savefile/F = new()
F << O
F >> loaded

//added so we can see the effect
loaded.loc = loc
del(O)
sleep(10)

//these two lines required to remove overlay
lay.name = null
lay.mouse_drop_pointer = null

//remove the overlay from loaded
loaded.overlays -= lay


Expected Results:
Comments explain the example.

Actual Results:
Comments explain the example.

Does the problem occur:
Every time? Or how often?
In other games?
In other user accounts?
On other computers?
Yes.

When does the problem NOT occur?
When you aren't using the rather piss-poor design of saving overlays into savefiles, but a bug's a bug.

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.)
I'd say it's been around for quite a while.

Workarounds:
Shown in code snippet.