wr = resolveAmsFor(waa, wr);
if (!streakMiss) { wr = resolveAmsFor(waa, wr); }
    private WeaponResult preTreatWeaponAttack(WeaponAttackAction waa) {        final Entity ae = game.getEntity(waa.getEntityId());        final Mounted weapon = ae.getEquipment(waa.getWeaponId());        final WeaponType wtype = (WeaponType)weapon.getType();        // 2003-01-02 BattleArmor MG and Small Lasers have unlimited ammo.        final boolean usesAmmo = wtype.getAmmoType() != AmmoType.T_NA &&            wtype.getAmmoType() != AmmoType.T_BA_MG &&            wtype.getAmmoType() != AmmoType.T_BA_SMALL_LASER &&            !wtype.hasFlag(WeaponType.F_INFANTRY);        Mounted ammo = null;        if (usesAmmo) {            if (waa.getAmmoId() > -1) {                ammo = ae.getEquipment(waa.getAmmoId());                weapon.setLinked(ammo);            } else {                ammo = weapon.getLinked();            }        }                WeaponResult wr = new WeaponResult();        wr.waa = waa;                // has this weapon fired already?        if (weapon.isUsedThisRound()) {            wr.toHit = new ToHitData(TargetRoll.IMPOSSIBLE, "Weapon has already been used this round");            return wr;        }        // is the weapon functional?        if (weapon.isUsedThisRound()) {            wr.toHit = new ToHitData(TargetRoll.IMPOSSIBLE, "Weapon was destroyed in a previous round");            return wr;        }        // is it jammed?        if (weapon.isJammed()) {            wr.toHit = new ToHitData(TargetRoll.IMPOSSIBLE, "Weapon is jammed");            return wr;        }                // make sure ammo is loaded        if (usesAmmo && (ammo == null || ammo.getShotsLeft() == 0 || ammo.isDumping())) {            ae.loadWeapon(weapon);            ammo = weapon.getLinked();        }                // compute to-hit        wr.toHit = Compute.toHitWeapon(game, waa, attacks);                // roll dice        wr.roll = Compute.d6(2);                // if the shot is possible and not a streak miss, add heat and use ammo        if (wr.toHit.getValue() != TargetRoll.IMPOSSIBLE        && (wtype.getAmmoType() != AmmoType.T_SRM_STREAK || wr.roll >= wr.toHit.getValue())) {            wr = addHeatUseAmmoFor(waa, wr);        }                // set the weapon as having fired        weapon.setUsedThisRound(true);                // resolve any AMS attacks on this attack        wr = resolveAmsFor(waa, wr);                return wr;    }