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