Subtypes of images get all variable definitions on them dumped into the root object, so it is impossible to distinguish between these and actual global variables.
When preceding a variable definition with a /, it does not show up in the outputted XML.
Numbered Steps to Reproduce Problem:
Compile the below code snipper with the CLI compiler's -o flag.
Code Snippet (if applicable) to Reproduce Problem:
/image/honk
icon_state = "hrm"
/var/nothingshere = "woosh"
/datum
/var/test1
var/test2
Expected Results:
<?xml version="1.0" encoding="Windows-1252" ?>
<dm>
<object file="test.dm:1">image
<object file="test.dm:1">honk
<var file="test.dm:2">icon_state
<val file="test.dm:2">"hrm"</val>
</var>
</object>
</object>
<var file="test.dm:4">nothingshere
<val file="test.dm:4">"woosh"</val>
</var>
<object file="test.dm:6">datum
<var file="test.dm:7">test1</var>
<var file="test.dm:8">test2</var>
</object>
</d m> // This line is NOT a bug, modified manually to make the website not parse it.
Actual Results:
<?xml version="1.0" encoding="Windows-1252" ?>
<dm>
<var file="test.dm:2">icon_state
<val file="test.dm:2">"hrm"</val>
</var>
<object file="test.dm:6">datum
<var file="test.dm:8">test2</var>
</object>
</d m> // This line is NOT a bug, modified manually to make the website not parse it.
Does the problem occur:
Every time? Or how often? Every Time
In other games? N/A
In other user accounts? Untested
On other computers? Untested
When does the problem NOT occur?
For problem 1: When you don't use a subtype of /image
For problem 2: When you don't put a / in front of variable definitions.
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.)
Workarounds:
First issue: No idea.
Second: Don't put a / before var defs.
This is equivalent to the following:
A slash at the beginning makes the declaration start from the root again.
The issue stands, however:
becomes