On Aurorastation (SS13 -- https://github.com/Aurorastation/Aurora.3 ) we began to receive reports that the server was crashing, and quickly discovered it was a specific scenario of opening crates in front of mirrors. I was able to reproduce the problem locally, and discovered that it is potentially an engine issue - at least insofar that it crashes silently rather than producing a runtime error.
Mirrors in our and other codebases create an /obj/effect/reflection that adds the turf they are on to vis_contents. They, themselves, are pixel-shifted off the turf prior to adding this turf. Any object that then modifies its vis_contents after the fact will cause an instant CTD if it is done on the /turf that the reflection is watching.
Numbered Steps to Reproduce Problem:
1. Place /atom/movable that manipulates its vis_contents var on a /turf that is in the vis_contents of another /atom/movable pixel-shifted off that turf
2. Activate the new atom's vis_contents manipulation
3. CTD 0xc0000005
Code Snippet (if applicable) to Reproduce Problem:
/atom/movable/atom_test
name = "test atom"
/atom/movable/atom_test/New()
// vis_contents += get_step(src, SOUTH) Has a similar effect, but no crash.
pixel_y = 32
vis_contents += get_turf(src)
/atom/movable/crash_test
name = "crash atom"
icon = 'icons/debug.dmi' // Can be anything
icon_state = "debug"
/atom/movable/crash_test/Click()
vis_contents += new /atom/movable/crash_effect
/atom/movable/crash_effect
name = "test overlay"
icon = 'icons/debug.dmi' // Can be anything
icon_state = "debug_lh"
Expected Results:
The object in question will display in the mirror properly, i.e. reflected with all vis_contents changes applied.
Actual Results:
Immediate crash to desktop once the object applies any changes to its vis_contents.
Does the problem occur:
Every time? Or how often? Every time.
In other games? Unknown.
In other user accounts? Yes.
On other computers? Yes.
When does the problem NOT occur? N/A.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? N/A.
Workarounds: Only way to avoid this is to not have an object add the turf it's "on" to vis_contents.