(rack == newRack && damage < newDamage) ) ) {
rack == newRack && damage < newDamage ) ) {
    private Vector explodeInfernoAmmoFromHeat(Entity entity) {        int damage = 0;        int rack = 0;        int boomloc = -1;        int boomslot = -1;        Vector vDesc = new Vector();        Report r;        // Find the most destructive Inferno ammo.        for (int j = 0; j < entity.locations(); j++) {            for (int k = 0; k < entity.getNumberOfCriticals(j); k++) {                CriticalSlot cs = entity.getCritical(j, k);                // Ignore empty, destroyed, hit, and structure slots.                if ( cs == null || cs.isDestroyed() || cs.isHit() ||                     cs.getType() != CriticalSlot.TYPE_EQUIPMENT ) {                    continue;                }                // Ignore everything but weapons slots.                Mounted mounted = entity.getEquipment                    ( entity.getCritical(j, k).getIndex() );                if (!(mounted.getType() instanceof AmmoType)) {                    continue;                }                // Ignore everything but Inferno ammo.                AmmoType atype = (AmmoType)mounted.getType();                if ( !atype.isExplosive() ||                     atype.getMunitionType() != AmmoType.M_INFERNO) {                    continue;                }                // Find the most destructive undamaged ammo.                // BMRr, pg. 48, compare one rack's                // damage.  Ties go to most rounds.                int newRack = atype.getDamagePerShot() * atype.getRackSize();                int newDamage = mounted.getExplosionDamage();                if ( !mounted.isHit() && ( rack < newRack ||                       (rack == newRack && damage < newDamage) ) ) {                    rack = newRack;                    damage = newDamage;                    boomloc = j;                    boomslot = k;                }            }        }        // Did we find anything to explode?        if (boomloc != -1 && boomslot != -1) {            CriticalSlot slot = entity.getCritical(boomloc, boomslot);            slot.setHit(true);            entity.getEquipment(slot.getIndex()).setHit(true);            // We've allocated heatBuildup to heat in resolveHeat(),            // so need to add to the entity's heat instead.            vDesc.addAll( explodeEquipment(entity, boomloc, boomslot));            entity.heat += 30;            r = new Report(5155);            r.indent();            r.subject = entity.getId();            r.add(entity.heat);            vDesc.addElement(r);            entity.heatBuildup = 0;        } else { //no ammo to explode            r = new Report(5160);            r.indent();            r.subject = entity.getId();            vDesc.addElement(r);        }        return vDesc;    }