if (en.getDependentLocation(loc) != Mech.LOC_NONE) {
if (en.getDependentLocation(loc) != Entity.LOC_NONE) {
    void destroyLocation(Entity en, int loc) {        // if it's already marked as destroyed, don't bother        if (en.getInternal(loc) < 0) {            return;        }        // mark armor, internal as doomed        en.setArmor(IArmorState.ARMOR_DOOMED, loc, false);        en.setInternal(IArmorState.ARMOR_DOOMED, loc);        if (en.hasRearArmor(loc)) {            en.setArmor(IArmorState.ARMOR_DOOMED, loc, true);        }        // equipment marked missing        for (Enumeration i = en.getEquipment(); i.hasMoreElements();) {            Mounted mounted = (Mounted)i.nextElement();            if (mounted.getLocation() == loc) {                mounted.setMissing(true);            }        }        // all critical slots set as missing        for (int i = 0; i < en.getNumberOfCriticals(loc); i++) {            final CriticalSlot cs = en.getCritical(loc, i);            if (cs != null) {                // count engine hits for maxtech engine explosions                if (cs.getType() == CriticalSlot.TYPE_SYSTEM &&                    cs.getIndex() == Mech.SYSTEM_ENGINE &&                    !cs.isDamaged()) {                        en.engineHitsThisRound++;                }                cs.setMissing(true);            }        }        // if it's a leg, the entity falls        if (en instanceof Mech && en.locationIsLeg(loc)) {            game.addPSR(new PilotingRollData(en.getId(), PilotingRollData.AUTOMATIC_FAIL, 5, "leg destroyed"));        }        // dependent locations destroyed        if (en.getDependentLocation(loc) != Mech.LOC_NONE) {            destroyLocation(en, en.getDependentLocation(loc));        }    }