Proc override order can be affected by the presence or absence of unrelated procs. Observe the difference between these two code samples:
Behavior A
/datum/foo() return 1
/datum/proc/foo() return 2
/client/New()
..()
src << new /datum():foo()
Compiler warns:
code\sandbox.dm:5:warning: foo: procedure override precedes definition
code\sandbox.dm:6:warning: foo: definition is here
And the output is "2".
Behavior B
/datum/proc/bar()
/datum/foo() return 1
/datum/proc/foo() return 2
/client/New()
..()
src << new /datum():foo()
The compiler does not warn, and the output is "1".
Expected Results:
A specific ordering of declaration and override should produce the same result regardless of the presence or absence of proc declarations under completely different names.
Actual Results:
This unrelated proc declaration affects code generation of completely different procs on that type in a non-obvious way.
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.)
Unknown.
Workarounds:
Always put the override after the declaration. Obey DM's warnings when it deigns to emit them. Have a really good understanding of arcane compiler internals when writing proc overrides. Cross your fingers?