1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-28 23:06:24 +02:00

Merge pull request #3777 from IvanSavenko/fix_autocombat_crash

Fix autocombat crash
This commit is contained in:
Ivan Savenko 2024-04-17 18:17:21 +03:00 committed by GitHub
commit 3b9bf8626a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 6 deletions

View File

@ -166,10 +166,6 @@ void CBattleAI::activeStack(const BattleID & battleID, const CStack * stack )
{
throw;
}
catch(std::exception &e)
{
logAi->error("Exception occurred in %s %s",__FUNCTION__, e.what());
}
if(result.actionType == EActionType::DEFEND)
{

View File

@ -729,7 +729,7 @@ void BattleInterface::requestAutofightingAIToTakeAction()
// FIXME: unsafe
// Run task in separate thread to avoid UI lock while AI is making turn (which might take some time)
// HOWEVER this thread won't atttempt to lock game state, potentially leading to races
boost::thread aiThread([this, activeStack]()
boost::thread aiThread([battleID = this->battleID, curInt = this->curInt, activeStack]()
{
setThreadName("autofightingAI");
curInt->autofightingAI->activeStack(battleID, activeStack);

View File

@ -202,7 +202,7 @@ void CIdentifierStorage::tryRequestIdentifier(const std::string & type, const Js
std::optional<si32> CIdentifierStorage::getIdentifier(const std::string & scope, const std::string & type, const std::string & name, bool silent) const
{
assert(state != ELoadingState::LOADING);
//assert(state != ELoadingState::LOADING);
auto options = ObjectCallback::fromNameAndType(scope, type, name, std::function<void(si32)>(), silent);
return getIdentifierImpl(options, silent);