for(troupe tr : troupes_joueur(player_id)){
        if(current_phase == CONQUETE_NIDS){

            
            if(can_exit_1st_phase()){  // exit 1st phase
                current_phase = RECHERCHE_PAIN;
                paths.at(tr.id).clear();
            }else{  // continue
                if(paths.at(tr.id).size() > 0){ // if instructions left
                    erreur can_continue = OK;
                    while(can_continue == OK && paths.at(tr.id).size() > 0){
                        can_continue = avancer(tr.id, paths.at(tr.id).at(0));
                        paths.at(tr.id).erase(paths.at(tr.id).begin());
                    }
                }else{
                    vector<position> nids_sorted = sort_by_distance(nids, tr.maman);

                    position target;
                    for(position nid_p : nids_sorted){
                        if(info_nid(nid_p) == LIBRE){
                            target = nid_p;
                            break;
                        }
                    }

                    paths.at(tr.id) = trouver_chemin(tr.maman, target);
                }
            }
            
        }

        if(current_phase == RECHERCHE_PAIN){

        }

        debug_poser_pigeon(tr.maman, PIGEON_JAUNE);

    }





  vector<troupe> troupes = troupes_joueur(player_id);
    for(troupe tr : troupes){
        after_death(tr);
        debug_poser_pigeon(trwh = trouver_chemin(tr.maman, target);
        printf("%d %d ; %d %d\n", tr.maman.colonne, tr.maman.ligne, target.colonne, target.ligne);
        for(direction d : path){
            string s = "nope";
            switch(d){
                case NORD:
                    s = "nord";
                    break;
                case SUD:
                    s = "sud";
                    break;
                case EST:
                    s = "est";
                    break;
                case OUEST:
                    s = "ouest";
                    break;
                default:
                    break;
            }
            cout << s << " ";
        }
        cout << endl;
        for(int i = 0; i < min((int)path.size(), 5); i++){
            avancer(tr.id, path.at(i));
        }
    } 



void after_death(troupe tr){

    int col = tr.maman.colonne, lin = tr.maman.ligne;
    if(col == 0 || col == LARGEUR - 1){
        avancer(tr.id, col == 0 ? EST : OUEST);
    }
    if(lin == 0 || lin == HAUTEUR - 1){
        avancer(tr.id, lin == 0 ? NORD : SUD);
    }
}