Fix compatibility for custom weapon bases

Small optimization and added fallback when checking for owner of weapon.