Objects in nested vis_contents containing a VIS_UNDERLAY get sorted incorrectly.
In the following structure where all objects are floated on plane and layer:
a { b {} c {} d { e {} f {} h { g(VIS_UNDERLAY) {} } } }
One would expect the following render order:
A B C D E F G H
But it actually appears that this is happening instead:
D H G E F A B C
The object that's gone wrong is definitely D, which is the grandparent of the object that's been marked as an underlay.
It appears as though VIS_UNDERLAY is traversing downward and being applied to the root object, rather than the parent object.
Anyway, here's a demo:
http://files.byondhome.com/Ter13/vis_underlay_bug_src.zip
When this is corrected, this is how the VIS_UNDERLAY demo should look: