Solve a segfault with piece animations

This commit is contained in:
Loic Guegan 2023-01-09 19:32:09 +01:00
parent 8e83bfb673
commit 179a173b3b

View file

@ -94,6 +94,7 @@ void GameTabLeftPanel::Notify(bool skip_animation) {
// Update capture and check if we should to animations during moves change:
if (m){
captures = m->GetLineCaptures();
if(!m->IsVariation()){ // Animations can lead to segfault when clicking on CGEditor move
if(m->HasParent(last_move)){
m->GetAbsoluteMove(src,dst);
animate=true;
@ -103,6 +104,7 @@ void GameTabLeftPanel::Notify(bool skip_animation) {
last_move->GetAbsoluteMove(dst,src);
animate=true;
}
}
} else if(game->GetNextMove()){ // First move animation
HalfMove *next=game->GetNextMove();
if(next==last_move){