mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-19 04:09:41 +00:00
Debug PGN import
This commit is contained in:
parent
ce941c146a
commit
a3c24f27f0
4 changed files with 12 additions and 8 deletions
|
@ -97,9 +97,13 @@ void MainWindow::OnOpen(wxCommandEvent &event) {
|
|||
fen = pgn.GetTagValue("FEN");
|
||||
}
|
||||
HalfMove *m = new HalfMove(pgnp_moves, fen);
|
||||
NewGame(new Game(m));
|
||||
} catch (...) {
|
||||
SHOW_DIALOG_ERROR("Invalid PGN file");
|
||||
Game *g=new Game(m,fen);
|
||||
for(std::string &s:pgn.GetTagList()){
|
||||
g->SetTag(s,pgn.GetTagValue(s));
|
||||
}
|
||||
NewGame(g);
|
||||
} catch (std::exception &e) {
|
||||
SHOW_DIALOG_ERROR("Invalid PGN file: " + std::string(e.what()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue