Fixes #5953.

Long overdue fix for a regression I introduced.

Closes #5953. (Or should, it is very hard to test that specific case.)

Based on code from #6159.
(Tested NRE crash case reported in #6159. Buildings no longer collect crates dropped on them.)
why not just use `HasTrait<T>()`?