left.blocked = true;
left.infProtected = true;
    private static LosEffects losDivided(IGame game, AttackInfo ai) {        Coords[] in = Coords.intervening(ai.attackPos, ai.targetPos, true);        LosEffects los = new LosEffects();        boolean targetInBuilding = false;        if (ai.targetEntity) {            targetInBuilding = Compute.isInBuilding(game, game.getBoard().getHex(ai.targetPos).floor(), ai.targetPos);        }        // If the target and attacker are both in a        // building, set that as the first LOS effect.        if ( targetInBuilding && Compute.isInBuilding( game, game.getBoard().getHex(ai.attackPos).floor(), ai.attackPos ) ) {            los.setThruBldg( game.getBoard().getBuildingAt( in[0] ) );        }        // add non-divided line segments        for (int i = 3; i < in.length - 2; i += 3) {            los.add( losForCoords(game, ai, in[i], los.getThruBldg()) );        }        if ((ai.minimumWaterDepth < 1) && ai.underWaterCombat) {            los.blocked = true;        }        // if blocked already, return that        if (los.losModifiers(game).getValue() == ToHitData.IMPOSSIBLE) {            return los;        }        // go through divided line segments        for (int i = 1; i < in.length - 2; i += 3) {            // get effects of each side            LosEffects left = losForCoords( game, ai, in[i], los.getThruBldg());            LosEffects right = losForCoords( game, ai, in[i+1], los.getThruBldg());                // If a target Entity is at a different elevation as its            // attacker, and if the attack is through a building, the            // target has cover.            final boolean isElevDiff = ai.attackAbsHeight != ai.targetAbsHeight;            if ((ai.minimumWaterDepth < 1) && ai.underWaterCombat) {                los.blocked = true;            }            if ( targetInBuilding && isElevDiff ) {                 if ( null != left.getThruBldg() ) {                     left.setTargetCover(COVER_HORIZONTAL);                 }                 if ( null != right.getThruBldg() ) {                     right.setTargetCover(COVER_HORIZONTAL);                 }            }                // Include all previous LOS effects.            left.add(los);            right.add(los);                // Infantry inside a building can only be            // targeted by units in the same building.            if ( ai.targetInfantry && targetInBuilding ) {                if ( null == left.getThruBldg() ) {                    left.blocked = true;                }                else if ( null == right.getThruBldg() ) {                    right.blocked = true;                }            }                // which is better?            int lVal = left.losModifiers(game).getValue();            int rVal = right.losModifiers(game).getValue();            if (lVal > rVal || (lVal == rVal && left.isAttackerCover())) {                los = left;            } else {                los = right;            }            if (game.getOptions().booleanOption("maxtech_partial_cover")) {                int cover = (left.targetCover & (COVER_LEFT | COVER_LOWLEFT)) |                            (right.targetCover & (COVER_RIGHT | COVER_LOWRIGHT));                if (cover < COVER_FULL && !(left.blocked && right.blocked)) {                    los.blocked = false;                    los.targetCover = cover;                }                cover = (left.attackerCover & (COVER_LEFT | COVER_LOWLEFT)) |                        (right.attackerCover & (COVER_RIGHT | COVER_LOWRIGHT));                if (cover < COVER_FULL && !(left.blocked && right.blocked)) {                    los.blocked = false;                    los.attackerCover = cover;                }            }        }        return los;    }