Fixes thuds in space and code for hats falling off

Fixes #2550 by adding a check for space turf at the location of the mob before playing a bodyfall sound

Fixes #2494 by following @Carn's suggestion of determining whether a hat will fall off based on its cover and hide flags. Security helmets, space helmets, biohoods, etc. have 0 chance of falling off when you fall over. Hats such as the captain's hat and the cakehat have a 40% chance, unless you're incapacitated or dead when you fall over, in which case they have 80% chance.

Thank you @Razharas and @MrPerson for help with bitflags.

Thanks @Supersayu for providing a lot of this code.

>Error checking merge status

:\