Commit b21d5dc6 authored by Chen Bill's avatar Chen Bill

fix undo after replay swapping

parent e082f6e0
......@@ -277,7 +277,6 @@ void ReplayMode::Restart(bool refresh) {
mainGame->dField.Clear();
//mainGame->device->setEventReceiver(&mainGame->dField);
cur_replay.Rewind();
//mainGame->dInfo.isFirst = true;
mainGame->dInfo.tag_player[0] = false;
mainGame->dInfo.tag_player[1] = false;
if(!StartDuel()) {
......@@ -287,7 +286,12 @@ void ReplayMode::Restart(bool refresh) {
mainGame->dField.RefreshAllCards();
mainGame->dInfo.isStarted = true;
mainGame->dInfo.isFinished = false;
//mainGame->dInfo.isReplay = true;
}
if (mainGame->dInfo.isReplaySwapped){
std::swap(mainGame->dInfo.lp[0], mainGame->dInfo.lp[1]);
std::swap(mainGame->dInfo.strLP[0], mainGame->dInfo.strLP[1]);
std::swap(mainGame->dInfo.hostname, mainGame->dInfo.clientname);
std::swap(mainGame->dInfo.hostname_tag, mainGame->dInfo.clientname_tag);
}
skip_turn = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment