mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-21 21:17:49 +02:00
Fixed warnings.
This commit is contained in:
parent
9ec3d2ef64
commit
f1cd4656ff
@ -122,7 +122,6 @@ TGoalVec Explore::getAllPossibleSubgoals()
|
||||
}
|
||||
}
|
||||
|
||||
auto primaryHero = ai->primaryHero().h;
|
||||
for(auto h : heroes)
|
||||
{
|
||||
for(auto obj : objs) //double loop, performance risk?
|
||||
|
@ -44,9 +44,6 @@ TSubgoal GatherArmy::whatToDoToAchieve()
|
||||
return fh->chooseSolution(getAllPossibleSubgoals()); //find dwelling. use current hero to prevent him from doing nothing.
|
||||
}
|
||||
|
||||
static const BuildingID unitsSource[] = { BuildingID::DWELL_LVL_1, BuildingID::DWELL_LVL_2, BuildingID::DWELL_LVL_3,
|
||||
BuildingID::DWELL_LVL_4, BuildingID::DWELL_LVL_5, BuildingID::DWELL_LVL_6, BuildingID::DWELL_LVL_7};
|
||||
|
||||
TGoalVec GatherArmy::getAllPossibleSubgoals()
|
||||
{
|
||||
//get all possible towns, heroes and dwellings we may use
|
||||
|
@ -193,7 +193,6 @@ bool AINodeStorage::isTileAccessible(int3 pos, const EPathfindingLayer layer) co
|
||||
{
|
||||
std::vector<AIPath> paths;
|
||||
auto chains = nodes[pos.x][pos.y][pos.z][layer];
|
||||
auto initialPos = hero->visitablePos();
|
||||
|
||||
for(const AIPathNode & node : chains)
|
||||
{
|
||||
|
@ -232,7 +232,7 @@ namespace AIPathfinding
|
||||
{
|
||||
AIPathNode * boatNode = boatNodeOptional.get();
|
||||
|
||||
if(boatNode->action == CGPathNode::NOT_SET)
|
||||
if(boatNode->action == CGPathNode::UNKNOWN)
|
||||
{
|
||||
boatNode->specialAction = virtualBoat;
|
||||
destination.blocked = false;
|
||||
|
@ -312,17 +312,20 @@ bool ResourceManager::removeOutdatedObjectives(std::function<bool(const Goals::T
|
||||
{ //unfortunately we can't use remove_if on heap
|
||||
auto it = boost::find_if(queue, [&](const ResourceObjective & ro) -> bool
|
||||
{
|
||||
predicate(ro.goal);
|
||||
return predicate(ro.goal);
|
||||
});
|
||||
|
||||
if(it != queue.end()) //removed at least one
|
||||
{
|
||||
logAi->debug("Removing goal %s from ResourceManager.", it->goal->name());
|
||||
queue.erase(queue.s_handle_from_iterator(it));
|
||||
removedAnything = true;
|
||||
}
|
||||
else //found nothing more to remove
|
||||
else
|
||||
{ //found nothing more to remove
|
||||
break;
|
||||
}
|
||||
}
|
||||
return removedAnything;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user