if (!other.isSpotting() || attacker.isEnemyOf(other)) { continue; }  LosEffects los = LosEffects.calculateLos(game, other.getId(), target); ToHitData mods = los.losModifiers(game); los.setTargetCover(LosEffects.COVER_NONE); mods.append(getAttackerMovementModifier(game, other.getId()));  if (spotter == null || mods.getValue() < bestMods.getValue()) { spotter = other; bestMods = mods;
if ( (other.isSpotting() || taggedBy == other.getId() ) && !attacker.isEnemyOf(other)) {  LosEffects los = LosEffects.calculateLos(game, other.getId(), target); ToHitData mods = los.losModifiers(game); los.setTargetCover(LosEffects.COVER_NONE); mods.append(getAttackerMovementModifier(game, other.getId()));  if (spotter == null || mods.getValue() < bestMods.getValue()) { spotter = other; bestMods = mods; }
    public static Entity findSpotter(IGame game, Entity attacker,            Targetable target) {        Entity spotter = null;        ToHitData bestMods = new ToHitData(ToHitData.IMPOSSIBLE, "");        for (java.util.Enumeration i = game.getEntities(); i.hasMoreElements();) {            Entity other = (Entity) i.nextElement();            if (!other.isSpotting() || attacker.isEnemyOf(other)) {                continue; // useless to us...            }            // what are this guy's mods to the attack?            LosEffects los = LosEffects.calculateLos(game, other.getId(),                    target);            ToHitData mods = los.losModifiers(game);            los.setTargetCover(LosEffects.COVER_NONE);            mods.append(getAttackerMovementModifier(game, other.getId()));            // is this guy a better spotter?            if (spotter == null || mods.getValue() < bestMods.getValue()) {                spotter = other;                bestMods = mods;            }        }        return spotter;    }