aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/Game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/Game.cpp')
-rw-r--r--src/game_tab/Game.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/game_tab/Game.cpp b/src/game_tab/Game.cpp
index 9028223..c1aa605 100644
--- a/src/game_tab/Game.cpp
+++ b/src/game_tab/Game.cpp
@@ -145,21 +145,8 @@ void Game::GetOpening(std::string &name,std::string &eco){
}else {
// If not, get the current move line (or first move)
// and try to guess opening
- auto line=m->GetLine(); // Vector of HalfMove
- std::string pgn;
- int count=1;
- for(int i=0;i<line.size();i++){
- if(i%2==0){
- pgn+=std::to_string(count)+".";
- count+=1;
- }
- pgn+=line[i]->move +" ";
- }
- // If there is a line, try to guess the opening
- if(pgn.size()>0){
- wxGetApp().GetBook().GuessOpening(pgn,name,eco);
- m->SetOpening(name,eco);
- }
+ wxGetApp().GetBook().GuessOpening(m->GetLineAsSAN(),name,eco);
+ m->SetOpening(name,eco);
}
}
}