for (EntityAction o : attacks) {
if (o instanceof ArtilleryAttackAction) {
newAttacks.addElement(o);
} else if (o instanceof WeaponAttackAction) {
WeaponAttackAction waa = (WeaponAttackAction) o;
Entity attacker = waa.getEntity(client.game);
Targetable target1 = waa.getTarget(client.game);
boolean curInFrontArc = Compute.isInArc(attacker.getPosition(),
attacker.getSecondaryFacing(), target1.getPosition(),
Compute.ARC_FORWARD);
if (curInFrontArc) {
WeaponAttackAction waa2 = new WeaponAttackAction(waa
.getEntityId(), waa.getTargetType(), waa
.getTargetId(), waa.getWeaponId());
waa2.setAimedLocation(waa.getAimedLocation());
waa2.setAimingMode(waa.getAimingMode());
waa2.setOtherAttackInfo(waa.getOtherAttackInfo());
waa2.setAmmoId(waa.getAmmoId());
waa2.setBombPayload(waa.getBombPayload());
newAttacks.addElement(waa2);
}
} else {
newAttacks.addElement(o);
}
}
// now add the attacks in rear/arm arcs
for (EntityAction o : attacks) {
if (o instanceof ArtilleryAttackAction) {
// newAttacks.addElement(o);
continue;
} else if (o instanceof WeaponAttackAction) {
WeaponAttackAction waa = (WeaponAttackAction) o;
Entity attacker = waa.getEntity(client.game);
Targetable target1 = waa.getTarget(client.game);
boolean curInFrontArc = Compute.isInArc(attacker.getPosition(),
attacker.getSecondaryFacing(), target1.getPosition(),
Compute.ARC_FORWARD);
if (!curInFrontArc) {
WeaponAttackAction waa2 = new WeaponAttackAction(waa
.getEntityId(), waa.getTargetType(), waa
.getTargetId(), waa.getWeaponId());