1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

- fix to last commit

- workaround to crash on disabling auto-battle (somehow client
"remembers" one command given during auto-battle)
This commit is contained in:
Ivan Savenko 2014-01-14 14:34:08 +00:00
parent c5b74a2dce
commit 47c91e03b5
2 changed files with 7 additions and 2 deletions

View File

@ -771,7 +771,12 @@ BattleAction CPlayerInterface::activeStack(const CStack * stack) //called when i
CBattleInterface *b = battleInt;
assert(!b->givenCommand->get()); //command buffer must be clean (we don't want to use old command)
if (b->givenCommand->get())
{
logGlobal->errorStream() << "Command buffer must be clean! (we don't want to use old command)";
vstd::clear_pointer(b->givenCommand->data);
}
{
boost::unique_lock<boost::recursive_mutex> un(*pim);
b->stackActivated(stack);

View File

@ -1913,7 +1913,7 @@ void CBattleInterface::blockUI(bool on)
// block only if during enemy turn and auto-fight is off
// othervice - crash on accessing non-exisiting active stack
bAutofight->block(curInt->isAutoFightOn || activeStack);
bAutofight->block(!curInt->isAutoFightOn && !activeStack);
if(tacticsMode && btactEnd && btactNext)
{