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:
commit
3b9bf8626a
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user