[colobot] 135/145: Fixed lockups when calling StartSuspend multiple times
Didier Raboud
odyx at moszumanska.debian.org
Mon Jul 11 12:56:26 UTC 2016
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit 6f412df2327174b4c2f1e36007d6dbf79376bb7e
Author: krzys-h <krzys_h at interia.pl>
Date: Mon Jul 4 17:02:39 2016 +0200
Fixed lockups when calling StartSuspend multiple times
---
src/level/robotmain.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp
index 36ee503..2aab95c 100644
--- a/src/level/robotmain.cpp
+++ b/src/level/robotmain.cpp
@@ -1554,11 +1554,13 @@ char* CRobotMain::GetDisplayInfoName(int index)
//! Beginning of a dialogue during the game
void CRobotMain::StartSuspend()
{
+ if (m_suspend != nullptr) return; // already suspended
if (!IsPhaseWithWorld(m_phase)) return;
+ GetLogger()->Info("Start suspend\n");
m_sound->MuteAll(true);
ClearInterface();
- m_suspend = m_pause->ActivatePause(PAUSE_ENGINE|PAUSE_HIDE_SHORTCUTS|PAUSE_MUTE_SOUND|PAUSE_CAMERA);
+ m_suspend = m_pause->ActivatePause(PAUSE_ENGINE | PAUSE_HIDE_SHORTCUTS | PAUSE_MUTE_SOUND | PAUSE_CAMERA);
m_engine->SetOverFront(false); // over flat behind
CreateShortcuts();
@@ -1572,6 +1574,9 @@ void CRobotMain::StartSuspend()
//! End of dialogue during the game
void CRobotMain::StopSuspend()
{
+ if (m_suspend == nullptr) return; // not suspended
+ GetLogger()->Info("Stop suspend\n");
+
m_sound->MuteAll(false);
ClearInterface();
m_pause->DeactivatePause(m_suspend);
@@ -1579,7 +1584,7 @@ void CRobotMain::StopSuspend()
m_engine->SetOverFront(true); // over flat front
CreateShortcuts();
- if(m_infoObject != nullptr)
+ if (m_infoObject != nullptr)
SelectObject(m_infoObject, false); // gives the command buttons
m_map->ShowMap(m_mapShow);
m_displayText->HideText(false);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list