if (ten != Entity.NONE && client.mechD.wPan.weaponList.getSelectedIndex() != -1) { ToHitData toHit = Compute.toHitWeapon(client.game, cen, ten, client.mechD.wPan.weaponList.getSelectedIndex());
final int weaponId = client.mechD.wPan.weaponList.getSelectedIndex(); if (ten != Entity.NONE && weaponId != -1) { ToHitData toHit = Compute.toHitWeapon(client.game, cen, ten, weaponId);
    private void updateTarget() {        // update target panel        if (ten != Entity.NONE && client.mechD.wPan.weaponList.getSelectedIndex() != -1) {            ToHitData toHit = Compute.toHitWeapon(client.game, cen, ten, client.mechD.wPan.weaponList.getSelectedIndex());            client.mechD.wPan.wTargetR.setText(te().getDisplayName());            client.mechD.wPan.wRangeR.setText("" + ce().getPosition().distance(te().getPosition()));            if (toHit.getValue() <= 12) {                client.mechD.wPan.wToHitR.setText(toHit.getValue() + " (" + Compute.oddsAbove(toHit.getValue()) + "%)");                butFire.setEnabled(true);            } else {                client.mechD.wPan.wToHitR.setText("Impossible");                butFire.setEnabled(false);            }            client.mechD.wPan.toHitText.setText(toHit.getDesc());        } else {            client.mechD.wPan.wTargetR.setText("---");            client.mechD.wPan.wRangeR.setText("---");            client.mechD.wPan.wToHitR.setText("---");            client.mechD.wPan.toHitText.setText("");        }    }