mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Minor improvements.
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user