Ammo tin code update

Much improved the code for ammo tins now, it's much cleaner, faster and
easier to read.

Also slightly improved swim-fly detection by adding an isnull check to
the animation library string.