if (isLocationDestroyed(loc)) {
if (isLocationBad(loc)) {
    public PilotingRollData addEntityBonuses(PilotingRollData roll) {      int[] locsToCheck = new int[4];      int destroyedLegs = 0;            locsToCheck = new int[4];      locsToCheck[0] = Mech.LOC_RLEG;      locsToCheck[1] = Mech.LOC_LLEG;      locsToCheck[2] = Mech.LOC_RARM;      locsToCheck[3] = Mech.LOC_LARM;            destroyedLegs = countDestroyedLegs();      if ( destroyedLegs == 0 )        roll.addModifier(-2, "Quad bonus");            for ( int i = 0; i < locsToCheck.length; i++ ) {        int loc = locsToCheck[i];                if (isLocationDestroyed(loc)) {          if ( destroyedLegs > 1 )            roll.addModifier(5, getLocationName(loc) + " destroyed");        } else {            // check for damaged hip actuators            if (getDestroyedCriticals(CriticalSlot.TYPE_SYSTEM, Mech.ACTUATOR_HIP, loc) > 0) {                roll.addModifier(2, getLocationName(loc) + " Hip Actuator destroyed");                if (!game.getOptions().booleanOption("maxtech_leg_damage"))                    continue;            }            // upper leg actuators?            if (getDestroyedCriticals(CriticalSlot.TYPE_SYSTEM, Mech.ACTUATOR_UPPER_LEG, loc) > 0) {                roll.addModifier(1, getLocationName(loc) + " Upper Leg Actuator destroyed");            }            // lower leg actuators?            if (getDestroyedCriticals(CriticalSlot.TYPE_SYSTEM, Mech.ACTUATOR_LOWER_LEG, loc) > 0) {                roll.addModifier(1, getLocationName(loc) + " Lower Leg Actuator destroyed");            }            // foot actuators?            if (getDestroyedCriticals(CriticalSlot.TYPE_SYSTEM, Mech.ACTUATOR_FOOT, loc) > 0) {                roll.addModifier(1, getLocationName(loc) + " Foot Actuator destroyed");            }        }      }      return super.addEntityBonuses(roll);    }