mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
NKAI: fix lock
This commit is contained in:
parent
0c1664dbe7
commit
cb297793e0
@ -669,7 +669,7 @@ void AIGateway::showBlockingDialog(const std::string & text, const std::vector<C
|
|||||||
sel = components.size();
|
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
|
// TODO: Find better way to understand it is Chest of Treasures
|
||||||
if(hero.validAndSet()
|
if(hero.validAndSet()
|
||||||
|
@ -44,8 +44,8 @@ namespace AIPathfinding
|
|||||||
enum DayFlags : ui8
|
enum DayFlags : ui8
|
||||||
{
|
{
|
||||||
NONE = 0,
|
NONE = 0,
|
||||||
FLY_CASTED = 1,
|
FLY_CAST = 1,
|
||||||
WATER_WALK_CASTED = 2
|
WATER_WALK_CAST = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AIPathNode : public CGPathNode
|
struct AIPathNode : public CGPathNode
|
||||||
|
@ -29,11 +29,11 @@ namespace AIPathfinding
|
|||||||
}
|
}
|
||||||
|
|
||||||
WaterWalkingAction::WaterWalkingAction(const CGHeroInstance * hero)
|
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)
|
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(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;
|
destination.blocked = false;
|
||||||
return;
|
return;
|
||||||
@ -79,7 +79,7 @@ namespace AIPathfinding
|
|||||||
|
|
||||||
if(source.node->layer == EPathfindingLayer::LAND && destination.node->layer == EPathfindingLayer::AIR)
|
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;
|
destination.blocked = false;
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user