mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-07 02:26:29 +02:00
Solve a segfault with piece animations
This commit is contained in:
parent
8e83bfb673
commit
179a173b3b
1 changed files with 10 additions and 8 deletions
|
@ -94,14 +94,16 @@ void GameTabLeftPanel::Notify(bool skip_animation) {
|
||||||
// Update capture and check if we should to animations during moves change:
|
// Update capture and check if we should to animations during moves change:
|
||||||
if (m){
|
if (m){
|
||||||
captures = m->GetLineCaptures();
|
captures = m->GetLineCaptures();
|
||||||
if(m->HasParent(last_move)){
|
if(!m->IsVariation()){ // Animations can lead to segfault when clicking on CGEditor move
|
||||||
m->GetAbsoluteMove(src,dst);
|
if(m->HasParent(last_move)){
|
||||||
animate=true;
|
m->GetAbsoluteMove(src,dst);
|
||||||
}else if(m->HasChild(last_move)){
|
animate=true;
|
||||||
// Accessing last_move here is safe since it is still
|
}else if(m->HasChild(last_move)){
|
||||||
// in the tree of moves (since HasChild found it so not deleted)
|
// Accessing last_move here is safe since it is still
|
||||||
last_move->GetAbsoluteMove(dst,src);
|
// in the tree of moves (since HasChild found it so not deleted)
|
||||||
animate=true;
|
last_move->GetAbsoluteMove(dst,src);
|
||||||
|
animate=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if(game->GetNextMove()){ // First move animation
|
} else if(game->GetNextMove()){ // First move animation
|
||||||
HalfMove *next=game->GetNextMove();
|
HalfMove *next=game->GetNextMove();
|
||||||
|
|
Loading…
Add table
Reference in a new issue