Mounted weapon = null;
if (selectedEntity == null || selectedWeapon == null) { return null; }
    private Mounted getSelectedArtilleryWeapon() {        Mounted weapon = null;        //TODO please eliminate the usage of the clientgui        if (clientgui != null) {            Entity e = clientgui.mechD.getCurrentEntity();                        if(e != null) {                weapon = e.getEquipment(clientgui.mechD.wPan.getSelectedWeaponNum());            }            if (weapon != null) {                if(!(weapon.getType() instanceof WeaponType && weapon.getType().hasFlag(WeaponType.F_ARTILLERY))) {                    weapon = null;                }                //otherwise, a weapon is selected, and it is artillery            }        }        return weapon;    }