diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 9d7047f93..b69646422 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -87,7 +87,7 @@ CPlayerInterface * LOCPLINT; CBattleInterface * CPlayerInterface::battleInt; enum EMoveState {STOP_MOVE, WAITING_MOVE, CONTINUE_MOVE, DURING_MOVE}; -CondSh stillMoveHero; //used during hero movement +CondSh stillMoveHero(STOP_MOVE); //used during hero movement int CPlayerInterface::howManyPeople = 0; diff --git a/client/battle/CBattleInterface.cpp b/client/battle/CBattleInterface.cpp index d56fbea17..b23ea88b5 100644 --- a/client/battle/CBattleInterface.cpp +++ b/client/battle/CBattleInterface.cpp @@ -46,7 +46,7 @@ * */ -CondSh CBattleInterface::animsAreDisplayed; +CondSh CBattleInterface::animsAreDisplayed(false); static void onAnimationFinished(const CStack *stack, CCreatureAnimation *anim) { diff --git a/client/gui/CGuiHandler.cpp b/client/gui/CGuiHandler.cpp index f8a154de3..2f18e6051 100644 --- a/client/gui/CGuiHandler.cpp +++ b/client/gui/CGuiHandler.cpp @@ -16,7 +16,7 @@ extern std::queue events; extern boost::mutex eventsM; -CondSh CGuiHandler::terminate_cond; +CondSh CGuiHandler::terminate_cond(false); boost::thread_specific_ptr inGuiThread; SObjectConstruction::SObjectConstruction(CIntObject *obj) diff --git a/lib/CondSh.h b/lib/CondSh.h index 1ec163571..c448007c7 100644 --- a/lib/CondSh.h +++ b/lib/CondSh.h @@ -17,15 +17,14 @@ template struct CondSh boost::condition_variable cond; boost::mutex mx; - CondSh() {} CondSh(T t) : data(t) {} // set data void set(T t) { - boost::unique_lock lock(mx); + boost::unique_lock lock(mx); data = t; - } + } // set data and notify void setn(T t) @@ -37,7 +36,7 @@ template struct CondSh // get stored value T get() { - boost::unique_lock lock(mx); + boost::unique_lock lock(mx); return data; } diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 97dd8c217..c833704f0 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -75,7 +75,7 @@ private: mutable CGameHandler * gh; }; -CondSh battleMadeAction; +CondSh battleMadeAction(false); CondSh battleResult(nullptr); template class CApplyOnGH;