瀏覽代碼

NKAI: fix lock

Andrii Danylchenko 1 年之前
父節點
當前提交
cb297793e0

+ 1 - 1
AI/Nullkiller/AIGateway.cpp

@@ -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
AI/Nullkiller/Pathfinding/AINodeStorage.h

@@ -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

+ 2 - 2
AI/Nullkiller/Pathfinding/Actions/AdventureSpellCastMovementActions.cpp

@@ -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)
 	{
 	}
 

+ 2 - 2
AI/Nullkiller/Pathfinding/Rules/AILayerTransitionRule.cpp

@@ -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;