else if (e.C3MasterIs(e) != entity.hasC3M()) {
else if ( e.C3MasterIs(e) && e.hasC3MM()) {   choC3.add( "Connect to " + e.getDisplayName() + " (" + nodes + " free)" ); entityCorrespondance[listIndex] = e.getId(); if (entity.C3MasterIs(e)) { choC3.select(listIndex); } listIndex++; } else if ( e.C3MasterIs(e) != entity.hasC3M() ) {
    private void refreshC3() {        choC3.removeAll();        int listIndex = 0;        entityCorrespondance = new int[client.game.getNoOfEntities() + 2];        if(entity.hasC3i()) {            choC3.add("Create new network (6 free)");            if(entity.getC3Master() == null) choC3.select(listIndex);            entityCorrespondance[listIndex++] = entity.getId();        }        else if(entity.hasC3M()) {            int nodes = entity.calculateFreeC3Nodes();            choC3.add("Set as company-level master (" + nodes + " free)");            if(entity.C3MasterIs(entity)) choC3.select(listIndex);            entityCorrespondance[listIndex++] = entity.getId();            choC3.add("Set as independant master (" + nodes + " free)");            if(entity.getC3Master() == null) choC3.select(listIndex);            entityCorrespondance[listIndex++] = -1;        }        for (Enumeration i = client.getEntities(); i.hasMoreElements();) {            final Entity e = (Entity)i.nextElement();            // ignore enemies or self            if(entity.isEnemyOf(e) || entity.equals(e)) {                continue;            }            // c3i only links with c3i            if (entity.hasC3i() != e.hasC3i()) {                continue;            }            int nodes = e.calculateFreeC3Nodes();            if (entity.C3MasterIs(e) && !entity.equals(e)) {                nodes++;            }            if (entity.hasC3i() && (entity.onSameC3NetworkAs(e) || entity.equals(e))) {                nodes++;            }            if (nodes == 0) {                continue;            }            if(e.hasC3i()) {                if (entity.onSameC3NetworkAs(e)) {                    choC3.add("Join " + e.getDisplayName() + " [netid " + e.getC3NetId() + ": " + (nodes - 1)  + " free]");                    choC3.select(listIndex);                }                else {                    choC3.add("Join " + e.getDisplayName() + " (netid " + e.getC3NetId() + ": " + nodes + " free)");                }                entityCorrespondance[listIndex++] = e.getId();            }            else if (e.C3MasterIs(e) != entity.hasC3M()) {                // if we're a slave-unit, we can only connect to sub-masters, not main masters                // likewise, if we're a master unit, we can only connect to main master units, not sub-masters            }            else if (entity.C3MasterIs(e)) {                choC3.add("Connect to " + e.getDisplayName() + " [" + (nodes - 1) + " free]");                choC3.select(listIndex);                entityCorrespondance[listIndex++] = e.getId();            }            else {                choC3.add("Connect to " + e.getDisplayName() + " (" + nodes + " free)");                entityCorrespondance[listIndex++] = e.getId();            }        }    }