|| (counter.isMissing())) {
|| (counter.isMissing()) || (ae.hasShield() && ae.hasActiveShield(counter.getLocation(), false))) {
    private WeaponResult resolveAmsFor(WeaponAttackAction waa, WeaponResult wr) {        final Entity te = game.getEntity(waa.getTargetId());        // any AMS attacks by the target?        Vector vCounters = waa.getCounterEquipment();        if (null != vCounters) {            // resolve AMS counter-fire            wr.amsShotDown = new int[vCounters.size()];            for (int x = 0; x < vCounters.size(); x++) {                wr.amsShotDown[x] = 0;                Mounted counter = (Mounted)vCounters.elementAt(x);                Mounted mAmmo = counter.getLinked();                if ((!(counter.getType() instanceof WeaponType))                        || (!(counter.getType().hasFlag(WeaponType.F_AMS)))                        || (!counter.isReady())                        || (counter.isMissing())) {                    continue;                }                // roll hits                int amsHits = Compute.d6(((WeaponType)counter.getType()).getDamage());                // build up some heat (assume target is ams owner)                if (counter.getType().hasFlag(WeaponType.F_HEATASDICE))                    te.heatBuildup += Compute.d6(((WeaponType)counter.getType()).getHeat());                else                    te.heatBuildup += ((WeaponType)counter.getType()).getHeat();                // decrement the ammo                if (mAmmo != null)                    mAmmo.setShotsLeft(Math.max(0, mAmmo.getShotsLeft() - amsHits));                // set the ams as having fired                counter.setUsedThisRound(true);                wr.amsShotDown[x]    = amsHits;                wr.amsShotDownTotal += amsHits;            }        }        return wr;    }