Terraria.ModLoader.PlayerHooks.CanHitNPCWithProj C# (CSharp) Method

CanHitNPCWithProj() public static method

public static CanHitNPCWithProj ( Projectile proj, NPC target ) : bool?
proj Projectile
target NPC
return bool?
        public static bool? CanHitNPCWithProj(Projectile proj, NPC target)
        {
            if (proj.npcProj || proj.trap)
            {
                return null;
            }
            Player player = Main.player[proj.owner];
            bool? flag = null;
            foreach (ModPlayer modPlayer in player.modPlayers)
            {
                bool? canHit = modPlayer.CanHitNPCWithProj(proj, target);
                if (canHit.HasValue && !canHit.Value)
                {
                    return false;
                }
                if (canHit.HasValue)
                {
                    flag = canHit.Value;
                }
            }
            return flag;
        }