mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
Merge pull request #7283 from IvanSavenko/sonar
[1.8] Fix new Sonar warnings
This commit is contained in:
@@ -800,10 +800,6 @@ void AIGateway::makeTurn()
|
||||
{
|
||||
logAi->debug("Making turn thread has been terminated. We'll end without calling endTurn");
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
logAi->error("Unknown exception in makeTurn. Ending turn without calling endTurn.");
|
||||
}
|
||||
}
|
||||
|
||||
void AIGateway::performObjectInteraction(const CGObjectInstance * obj, HeroPtr heroPtr)
|
||||
|
||||
@@ -248,13 +248,13 @@ public:
|
||||
|
||||
void add(std::unique_ptr<T> t)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(sync);
|
||||
std::lock_guard lock(sync);
|
||||
pool.push_back(std::move(t));
|
||||
}
|
||||
|
||||
ptr_type acquire()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(sync);
|
||||
std::lock_guard lock(sync);
|
||||
bool poolIsEmpty = pool.empty();
|
||||
T * element = poolIsEmpty
|
||||
? elementFactory().release()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "../Goals/ExecuteHeroChain.h"
|
||||
#include "../Goals/RecruitHero.h"
|
||||
#include "../Markers/DefendTown.h"
|
||||
#include "../../lib/IGameSettings.h"
|
||||
#include "../../../lib/IGameSettings.h"
|
||||
|
||||
namespace NK2AI
|
||||
{
|
||||
|
||||
@@ -385,7 +385,7 @@ HeroLockedReason Nullkiller::getHeroLockedReason(const CGHeroInstance * hero) co
|
||||
|
||||
void Nullkiller::makeTurn()
|
||||
{
|
||||
std::lock_guard<std::mutex> sharedStorageLock(AISharedStorage::locker);
|
||||
std::lock_guard sharedStorageLock(AISharedStorage::locker);
|
||||
pathfinderTurnStorageMisses.store(0);
|
||||
const int MAX_DEPTH = 10;
|
||||
resetState();
|
||||
|
||||
Reference in New Issue
Block a user