DM confuses top-level vars with the vars of instances if they are not typecasted.
Code Snippet (if applicable) to Reproduce Problem:
var/myvar = "I'm a top-level var."
obj/var/myvar = "I'm a var."
proc/testvar()
var/o = new /obj
if(o:myvar == myvar)
world << "Something is very wrong here!"
mob/verb/test()
testvar()
Expected Results:
Nothing happens, because obj.myvar != global.myvar.
Actual Results:
The code above does output the message, which should never happen.
Also, Dream Maker complains: warning: o: variable defined but not used
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.)
Edit: There were none that I could find.
Workarounds:
Use typecasting:
var/myvar = "I'm a top-level var."
obj/var/myvar = "I'm a var."
proc/testvar()
var/obj/o = new /obj
if(o:myvar == myvar)
world << "Something is very wrong here!"
mob/verb/test()
testvar()
In this case, there is no output, as you would expect.
The following test case shows the same output as far back as 354.913, the earliest available version:
It's strange because I thought it was working before. I guess not.