Containment fiels bounce structure, machinery & mechs, take two

New attempt at #5432

This should fix the infinite loop bug that caused the revert. I say should because I can't reproduce it consistently, so I can't be 100% sure, but I'm pretty sure it's no longer happening.