wr.waa.setTargetType(Targetable.TYPE_ENTITY);
    private WeaponResult convertHomingShotToEntityTarget(ArtilleryAttackAction aaa, Entity ae) {        WeaponResult wr = aaa.getWR();        Targetable target = wr.waa.getTarget(game);                final Coords tc = target.getPosition();        Entity entityTarget = null;        TagInfo info = null;        Entity tagger = null;        for(int pass=0;pass<2;pass++) {            int bestDistance = Integer.MAX_VALUE;            int bestIndex = -1;            Vector v = game.getTagInfo();            for(int i=0;i<v.size();i++) {                info = (TagInfo)v.elementAt(i);                tagger = game.getEntity(info.attackerId);                if(info.shots < info.priority && !ae.isEnemyOf(tagger)) {                    System.err.println("Checking TAG "+i+" with priority "+info.priority);                    entityTarget = game.getEntity(info.targetId);                    if(entityTarget != null && entityTarget.isOnSameSheet(tc)) {                        if(tc.distance(entityTarget.getPosition()) < bestDistance) {                            bestIndex = i;                            bestDistance = tc.distance(entityTarget.getPosition());                            if(!game.getOptions().booleanOption("a4homing_target_area")) {                                break; //first will do if mapsheets can't overlap                            }                        }                    }                }            }            if(bestIndex != -1) {                info = (TagInfo)v.elementAt(bestIndex);                entityTarget = game.getEntity(info.targetId);                tagger = game.getEntity(info.attackerId);                System.err.println("attacker: " + ae.getDisplayName());                System.err.println("   " + tagger.getDisplayName() + " selected to TAG");                System.err.println("   " + entityTarget.getDisplayName() + " selected as target");                info.shots++;                game.updateTagInfo(info,bestIndex);                break; //got a target, stop searching            } else {                entityTarget = null;            }            //nothing found on 1st pass, so clear shots fired to 0            System.err.println("nothing on 1st pass");            game.clearTagInfoShots(ae, tc);        }        if(entityTarget == null || info == null) {            wr.toHit = new ToHitData(ToHitData.IMPOSSIBLE, "no targets tagged on map sheet");        }         else if(info.missed) {            wr.waa.setTargetId(entityTarget.getId());            wr.toHit = new ToHitData(ToHitData.IMPOSSIBLE, "tag missed the target");        } else {            //update for hit table resolution            wr.artyAttackerCoords = tagger.getPosition();            wr.waa.setTargetId(entityTarget.getId());            wr.waa.setTargetType(Targetable.TYPE_ENTITY);        }        return wr;    }