]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Constructor/splitter.cpp
hay pequenias modificaciones en el workplace, se cuelga por eso pero en un rato lo...
[z.facultad/75.42/plaqui.git] / Constructor / splitter.cpp
index 32b32804eda2f8b144d356b98c6d2fa4c967552e..c228db6c51d51dc4ae702c58b27dd8857144e6d5 100644 (file)
@@ -109,6 +109,7 @@ void Splitter::save(FILE *archivo)
 
 bool Splitter::check_connection()
 {
 
 bool Splitter::check_connection()
 {
+       ConnectorType aux;
        CItem *_item0, *_item1;
        switch (get_img_actual()) {
                        case 0:
        CItem *_item0, *_item1;
        switch (get_img_actual()) {
                        case 0:
@@ -128,9 +129,12 @@ bool Splitter::check_connection()
                                connect_vec[0].type = is_other_connection_area( get_position_x() + 16, get_position_y()+get_image()->get_height() + 5, &_item0); //abajo-izquierda v
        }
        if (connect_vec[0].type != UNDEF && connect_vec[1].type != UNDEF) {
                                connect_vec[0].type = is_other_connection_area( get_position_x() + 16, get_position_y()+get_image()->get_height() + 5, &_item0); //abajo-izquierda v
        }
        if (connect_vec[0].type != UNDEF && connect_vec[1].type != UNDEF) {
+               aux = connect_vec[0].type; 
+               connect_vec[0].type = connect_vec[1].type;
+               connect_vec[1].type = aux;
                connect_vec[0].id_dest = _item0->get_id();
                connect_vec[1].id_dest = _item1->get_id();
                connect_vec[0].id_dest = _item0->get_id();
                connect_vec[1].id_dest = _item1->get_id();
-               return ( is_connected = (connect_vec[0].type == connect_vec[1].type) );
+               return ( is_connected = (connect_vec[0].type != connect_vec[1].type) );
        }
        else return is_connected;
 }
        }
        else return is_connected;
 }