mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Minor improvements.
This commit is contained in:
parent
dd808ef5cc
commit
1a2c8de6ad
@ -621,6 +621,9 @@ void CPlayerInterface::battleStart(const CCreatureSet *army1, const CCreatureSet
|
||||
|
||||
waitForAllDialogs();
|
||||
|
||||
if(isAutoFightOn)
|
||||
GH.topInt()->deactivate();
|
||||
|
||||
BATTLE_EVENT_POSSIBLE_RETURN;
|
||||
|
||||
GH.pushInt(battleInt);
|
||||
@ -758,7 +761,6 @@ BattleAction CPlayerInterface::activeStack(const CStack * stack) //called when i
|
||||
{
|
||||
if(isAutoFightOn)
|
||||
{
|
||||
assert(autofightingAI);
|
||||
auto ret = autofightingAI->activeStack(stack);
|
||||
if(isAutoFightOn)
|
||||
{
|
||||
|
@ -3588,7 +3588,7 @@ void CBattleInterface::requestAutofightingAIToTakeAction()
|
||||
{
|
||||
assert(curInt->isAutoFightOn);
|
||||
|
||||
auto tmp = make_unique<boost::thread>([&]
|
||||
boost::thread aiThread([&]
|
||||
{
|
||||
auto ba = new BattleAction(curInt->autofightingAI->activeStack(activeStack));
|
||||
|
||||
@ -3598,11 +3598,13 @@ void CBattleInterface::requestAutofightingAIToTakeAction()
|
||||
}
|
||||
else
|
||||
{
|
||||
delete ba;
|
||||
boost::unique_lock<boost::recursive_mutex> un(*LOCPLINT->pim);
|
||||
activateStack();
|
||||
}
|
||||
});
|
||||
tmp->detach();
|
||||
|
||||
aiThread.detach();
|
||||
}
|
||||
|
||||
CBattleInterface::SiegeHelper::SiegeHelper(const CGTownInstance *siegeTown, const CBattleInterface * _owner)
|
||||
|
Loading…
Reference in New Issue
Block a user