public void addAttack(AttackAction aa) {
public synchronized void addAttack(AttackAction aa) {
    public void addAttack(AttackAction aa) {        // do not make a sprite unless we're aware of both entities        // this is not a great solution but better than a crash        Entity ae = game.getEntity(aa.getEntityId());        Targetable t = game.getTarget(aa.getTargetType(), aa.getTargetId());        if (ae == null || t == null || t.getTargetType() == Targetable.TYPE_INARC_POD) {            return;        }        for (final Iterator i = attackSprites.iterator(); i.hasNext();) {            final AttackSprite sprite = (AttackSprite)i.next();            // can we just add this attack to an existing one?            if (sprite.getEntityId() == aa.getEntityId()                && sprite.getTargetId() == aa.getTargetId()) {                // use existing attack, but add this weapon                if (aa instanceof WeaponAttackAction) {                    WeaponAttackAction waa = (WeaponAttackAction)aa;                    if ( aa.getTargetType() != Targetable.TYPE_HEX_ARTILLERY) {                        sprite.addWeapon(waa);                    } else if ( waa.getEntity(game).getOwner().getId() == localPlayer.getId()) {                        sprite.addWeapon(waa);                    }                }                if (aa instanceof KickAttackAction) {                    sprite.addWeapon((KickAttackAction)aa);                }                if (aa instanceof PunchAttackAction) {                    sprite.addWeapon((PunchAttackAction)aa);                }                if (aa instanceof PushAttackAction) {                    sprite.addWeapon((PushAttackAction)aa);                }                if (aa instanceof ClubAttackAction) {                    sprite.addWeapon((ClubAttackAction)aa);                }                if (aa instanceof ChargeAttackAction) {                    sprite.addWeapon((ChargeAttackAction)aa);                }                if (aa instanceof DfaAttackAction) {                    sprite.addWeapon((DfaAttackAction)aa);                }                if (aa instanceof ProtomechPhysicalAttackAction) {                    sprite.addWeapon((ProtomechPhysicalAttackAction)aa);                }                if (aa instanceof SearchlightAttackAction) {                    sprite.addWeapon((SearchlightAttackAction)aa);                }                return;            }        }        // no re-use possible, add a new one        // don't add a sprite for an artillery attack made by the other player        if (aa instanceof WeaponAttackAction) {            WeaponAttackAction waa = (WeaponAttackAction)aa;            if ( aa.getTargetType() != Targetable.TYPE_HEX_ARTILLERY) {                attackSprites.addElement(new AttackSprite(aa));            } else if ( waa.getEntity(game).getOwner().getId() == localPlayer.getId()) {                attackSprites.addElement(new AttackSprite(aa));            }        } else {            attackSprites.addElement(new AttackSprite(aa));        }    }