Commit 1af7ff22 authored by DailyShana's avatar DailyShana

fix replay undo, #2101

ReplayMode::Undo() is in the same threat of the Game::MainLoop(), so the
gMutex.Lock() there is meaningless.
parent 4dbb6a21
......@@ -735,7 +735,7 @@ void Game::MainLoop() {
soundManager.PlayBGM(BGM_DECK);
DrawBackImage(imageManager.tBackGround_deck);
DrawDeckBd();
} else if(!dInfo.isReplaySkiping) {
} else {
soundManager.PlayBGM(BGM_MENU);
DrawBackImage(imageManager.tBackGround_menu);
}
......
......@@ -106,6 +106,7 @@ int ReplayMode::ReplayThread(void* param) {
get_message(pduel, (byte*)engineBuffer);
is_continuing = ReplayAnalyze(engineBuffer, len);
if(is_restarting) {
mainGame->gMutex.Lock();
is_restarting = false;
int step = current_step - 1;
if(step < 0)
......@@ -280,7 +281,6 @@ void ReplayMode::Undo() {
return;
mainGame->dInfo.isReplaySkiping = true;
Restart(false);
mainGame->gMutex.Lock();
Pause(false, false);
}
bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
......
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