C++ Node Deletion Between List Logic
===

After learning and building several quadtrees and octrees, and really liking subdivision, I decided to use subdivision in my server.  But, only placing nodes within themselves.  My problem is, I cant figure out how to link the previous node, to the next one if the node is in the middle.  I am wondering if I am doing this correctly.  Below is my code and I comment where the problem area is.  Any help would be great!

    bool deleteNode ( SOCKET s , client_information_class *prev ) {
              bool return_value = false;
              if ( node[0]->client_socket != s ) {
                   if ( node[0]->node != NULL ) {
                        return_value = node[0]->deleteNode ( s , *node );
                   } else {
                        cout << endl << "Can not call deleteNode anymore ... Did not find the node to delete ... " << endl;
                        return return_value;
                   }
              } else {
                   if ( node[0]->client_state == 1 )
                        InterlockedDecrement(&connection_count);
                   if ( node[0]->node != NULL ) {          // there is a next node
                        client_information_class **next = node[0]->node;
                        if ( next[0]->node != NULL ) {
                             // problem area
                             cout << endl << "next[0]->node is not null" << endl;
                             prev->node = next[0]->node[0]->node; // ??? I know its wrong
                        } else {
                             // problem area
                             cout << endl << "next[0]->node is null" << endl;
                             prev->node = next[0]->node;  // ??? I know its wrong
                        }
                        delete node;
                   } else {                                   // its the last one
                        prev->node = NULL;
                        delete node;
                   }
                   InterlockedDecrement(&socket_count);
                   return_value = true;
              }
              return return_value;
    }