1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

NKAI: fix build

This commit is contained in:
Andrii Danylchenko 2024-03-28 15:37:30 +02:00
parent 30d9daf62c
commit ff654c2148
5 changed files with 6 additions and 9 deletions

View File

@ -28,7 +28,7 @@ namespace AIPathfinding
bool allowBypassObjects) bool allowBypassObjects)
{ {
std::vector<std::shared_ptr<IPathfindingRule>> rules = { std::vector<std::shared_ptr<IPathfindingRule>> rules = {
std::make_shared<AILayerTransitionRule>(cb, ai, nodeStorage, allowBypassObjects), std::make_shared<AILayerTransitionRule>(cb, ai, nodeStorage),
std::make_shared<DestinationActionRule>(), std::make_shared<DestinationActionRule>(),
std::make_shared<AIMovementToDestinationRule>(nodeStorage, allowBypassObjects), std::make_shared<AIMovementToDestinationRule>(nodeStorage, allowBypassObjects),
std::make_shared<MovementCostRule>(), std::make_shared<MovementCostRule>(),

View File

@ -99,6 +99,7 @@ class ISpecialActionFactory
{ {
public: public:
virtual std::shared_ptr<SpecialAction> create(const Nullkiller * ai) = 0; virtual std::shared_ptr<SpecialAction> create(const Nullkiller * ai) = 0;
virtual ~ISpecialActionFactory() = default;
}; };
} }

View File

@ -122,7 +122,7 @@ public:
ConnectionCostInfo currentCost = getConnectionsCost(paths); ConnectionCostInfo currentCost = getConnectionsCost(paths);
if(currentCost.connectionsCount <= 1 || currentCost.connectionsCount == 2 && currentCost.totalCost < 3.0f) if(currentCost.connectionsCount <= 2)
return; return;
float neighborCost = getNeighborConnectionsCost(pos, paths); float neighborCost = getNeighborConnectionsCost(pos, paths);
@ -179,7 +179,6 @@ private:
{ {
auto from = path.targetHero->visitablePos(); auto from = path.targetHero->visitablePos();
auto fromObj = actorObjectMap[path.targetHero]; auto fromObj = actorObjectMap[path.targetHero];
auto fromTile = cb->getTile(from);
auto danger = ai->pathfinder->getStorage()->evaluateDanger(pos, path.targetHero, true); auto danger = ai->pathfinder->getStorage()->evaluateDanger(pos, path.targetHero, true);
auto updated = target->tryAddConnection( auto updated = target->tryAddConnection(

View File

@ -20,9 +20,8 @@ namespace AIPathfinding
AILayerTransitionRule::AILayerTransitionRule( AILayerTransitionRule::AILayerTransitionRule(
CPlayerSpecificInfoCallback * cb, CPlayerSpecificInfoCallback * cb,
Nullkiller * ai, Nullkiller * ai,
std::shared_ptr<AINodeStorage> nodeStorage, std::shared_ptr<AINodeStorage> nodeStorage)
bool allowEmbark) :cb(cb), ai(ai), nodeStorage(nodeStorage)
:cb(cb), ai(ai), nodeStorage(nodeStorage), allowEmbark(allowEmbark)
{ {
setup(); setup();
} }

View File

@ -32,14 +32,12 @@ namespace AIPathfinding
std::map<const CGHeroInstance *, std::shared_ptr<const SummonBoatAction>> summonableVirtualBoats; std::map<const CGHeroInstance *, std::shared_ptr<const SummonBoatAction>> summonableVirtualBoats;
std::map<const CGHeroInstance *, std::shared_ptr<const WaterWalkingAction>> waterWalkingActions; std::map<const CGHeroInstance *, std::shared_ptr<const WaterWalkingAction>> waterWalkingActions;
std::map<const CGHeroInstance *, std::shared_ptr<const AirWalkingAction>> airWalkingActions; std::map<const CGHeroInstance *, std::shared_ptr<const AirWalkingAction>> airWalkingActions;
bool allowEmbark;
public: public:
AILayerTransitionRule( AILayerTransitionRule(
CPlayerSpecificInfoCallback * cb, CPlayerSpecificInfoCallback * cb,
Nullkiller * ai, Nullkiller * ai,
std::shared_ptr<AINodeStorage> nodeStorage, std::shared_ptr<AINodeStorage> nodeStorage);
bool allowEmbark);
virtual void process( virtual void process(
const PathNodeInfo & source, const PathNodeInfo & source,