Problem removing nodes from a list

0

Good evening,

I'm doing a program that is kind of a "candy crush" in SDL. And I needed your help to help me remove the balls from the game, which in this case are the nodes in the list.

The program is going through the game looking for the nodes that you have to remove that are marked with 1 in the defenicos.marca field.

I hope you have been more specific this time!

Thanks for the help!

Errorr: segmentaion fault (Core dumped)

bolhas_ligadas *remove_bolhas(bolhas_ligadas *lista,int largura,int altura){
  bolhas_ligadas *aux,*aux4;
  int i,j;
  aux=lista;
  for(j=0;j<largura;j++){

    for(i=0;i<altura;i++){

      aux4=aux->next;
      if(aux4->defenicoes.marca==1){

        aux->next=aux4->next;  
        free(aux4);   
      }

      aux=aux->next;

    }
  } 
  return lista;
}
    
asked by anonymous 13.12.2017 / 21:16

0 answers