match ammo types when applying inventory templates

uses only weapons that are loaded with the target ammo type
if no weapon is found with the target ammo, but the weapon and the ammo are found separately, unloads the weapon (if necessary), loads the weapon with the target ammo, and uses it