This action decides shootability:
function AutoGun.ActionDamage(damage, actions)
if actions then
for _,action in pairs(actions) do
if action.type == "direct" then
for _,action_delivery in pairs(action.action_delivery) do
if (action_delivery.type == "instant") and (action_delivery.target_effects) then
for _,target_effect in pairs(action_delivery.target_effects) do
if target_effect.type == "damage" then
-- some ammo has multiple direct instant damage sources
damage.value = damage.value + target_effect.damage.amount
end
end
elseif action_delivery.type == "projectile" then
-- Projecty ammo type damage calculation
AutoGun.ActionDamage(damage, action_delivery.final_action)
end
end
end
end
end
end
In case the attack is not direct, the ammo is not loaded.