mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +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:
parent
c5b74a2dce
commit
47c91e03b5
@ -771,7 +771,12 @@ BattleAction CPlayerInterface::activeStack(const CStack * stack) //called when i
|
|||||||
|
|
||||||
CBattleInterface *b = battleInt;
|
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);
|
boost::unique_lock<boost::recursive_mutex> un(*pim);
|
||||||
b->stackActivated(stack);
|
b->stackActivated(stack);
|
||||||
|
@ -1913,7 +1913,7 @@ void CBattleInterface::blockUI(bool on)
|
|||||||
|
|
||||||
// block only if during enemy turn and auto-fight is off
|
// block only if during enemy turn and auto-fight is off
|
||||||
// othervice - crash on accessing non-exisiting active stack
|
// othervice - crash on accessing non-exisiting active stack
|
||||||
bAutofight->block(curInt->isAutoFightOn || activeStack);
|
bAutofight->block(!curInt->isAutoFightOn && !activeStack);
|
||||||
|
|
||||||
if(tacticsMode && btactEnd && btactNext)
|
if(tacticsMode && btactEnd && btactNext)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user