NKAI: fix lock

This commit is contained in:
Andrii Danylchenko committed 2024-01-21 10:05:40 +02:00
1 parent 0c1664dbe7
commit cb297793e0
4 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -669,7 +669,7 @@ void AIGateway::showBlockingDialog(const std::string & text, const std::vector<C
sel = components.size();
{
std::unique_lock<std::mutex>(nullkiller->aiStateMutex);
std::unique_lock<std::mutex> mxLock(nullkiller->aiStateMutex);
// TODO: Find better way to understand it is Chest of Treasures
if(hero.validAndSet()
+2 -2
View File
@@ -44,8 +44,8 @@ namespace AIPathfinding
enum DayFlags : ui8
{
NONE = 0,
FLY_CASTED = 1,
WATER_WALK_CASTED = 2
FLY_CAST = 1,
WATER_WALK_CAST = 2
};
struct AIPathNode : public CGPathNode
@@ -29,11 +29,11 @@ namespace AIPathfinding
}
WaterWalkingAction::WaterWalkingAction(const CGHeroInstance * hero)
:AdventureCastAction(SpellID::WATER_WALK, hero, DayFlags::WATER_WALK_CASTED)
:AdventureCastAction(SpellID::WATER_WALK, hero, DayFlags::WATER_WALK_CAST)
{ }
AirWalkingAction::AirWalkingAction(const CGHeroInstance * hero)
: AdventureCastAction(SpellID::FLY, hero, DayFlags::FLY_CASTED)
: AdventureCastAction(SpellID::FLY, hero, DayFlags::FLY_CAST)
{
}
@@ -61,7 +61,7 @@ namespace AIPathfinding
if(source.node->layer == EPathfindingLayer::LAND && destination.node->layer == EPathfindingLayer::WATER)
{
if(nodeStorage->getAINode(source.node)->dayFlags & DayFlags::WATER_WALK_CASTED)
if(nodeStorage->getAINode(source.node)->dayFlags & DayFlags::WATER_WALK_CAST)
{
destination.blocked = false;
return;
@@ -79,7 +79,7 @@ namespace AIPathfinding
if(source.node->layer == EPathfindingLayer::LAND && destination.node->layer == EPathfindingLayer::AIR)
{
if(nodeStorage->getAINode(source.node)->dayFlags & DayFlags::FLY_CASTED)
if(nodeStorage->getAINode(source.node)->dayFlags & DayFlags::FLY_CAST)
{
destination.blocked = false;
return;