mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Merge pull request #5020 from IvanSavenko/ai_object_fix
Fix AI not recruiting heroes when map reveal is off
This commit is contained in:
commit
102dfd0966
@ -281,6 +281,9 @@ void AIGateway::tileRevealed(const std::unordered_set<int3> & pos)
|
||||
for(const CGObjectInstance * obj : myCb->getVisitableObjs(tile))
|
||||
addVisitableObj(obj);
|
||||
}
|
||||
|
||||
if (nullkiller->settings->isUpdateHitmapOnTileReveal())
|
||||
nullkiller->dangerHitMap->reset();
|
||||
}
|
||||
|
||||
void AIGateway::heroExchangeStarted(ObjectInstanceID hero1, ObjectInstanceID hero2, QueryID query)
|
||||
|
@ -348,6 +348,7 @@ std::set<const CGObjectInstance *> DangerHitMapAnalyzer::getOneTurnAccessibleObj
|
||||
void DangerHitMapAnalyzer::reset()
|
||||
{
|
||||
hitMapUpToDate = false;
|
||||
tileOwnersUpToDate = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ namespace NKAI
|
||||
pathfinderBucketSize(32),
|
||||
allowObjectGraph(true),
|
||||
useTroopsFromGarrisons(false),
|
||||
updateHitmapOnTileReveal(false),
|
||||
openMap(true),
|
||||
useFuzzy(false)
|
||||
{
|
||||
@ -55,6 +56,7 @@ namespace NKAI
|
||||
retreatThresholdAbsolute = node["retreatThresholdAbsolute"].Float();
|
||||
safeAttackRatio = node["safeAttackRatio"].Float();
|
||||
allowObjectGraph = node["allowObjectGraph"].Bool();
|
||||
updateHitmapOnTileReveal = node["updateHitmapOnTileReveal"].Bool();
|
||||
openMap = node["openMap"].Bool();
|
||||
useFuzzy = node["useFuzzy"].Bool();
|
||||
useTroopsFromGarrisons = node["useTroopsFromGarrisons"].Bool();
|
||||
|
@ -33,6 +33,7 @@ namespace NKAI
|
||||
float safeAttackRatio;
|
||||
bool allowObjectGraph;
|
||||
bool useTroopsFromGarrisons;
|
||||
bool updateHitmapOnTileReveal;
|
||||
bool openMap;
|
||||
bool useFuzzy;
|
||||
|
||||
@ -51,6 +52,7 @@ namespace NKAI
|
||||
int getPathfinderBucketSize() const { return pathfinderBucketSize; }
|
||||
bool isObjectGraphAllowed() const { return allowObjectGraph; }
|
||||
bool isGarrisonTroopsUsageAllowed() const { return useTroopsFromGarrisons; }
|
||||
bool isUpdateHitmapOnTileReveal() const { return updateHitmapOnTileReveal; }
|
||||
bool isOpenMap() const { return openMap; }
|
||||
bool isUseFuzzy() const { return useFuzzy; }
|
||||
};
|
||||
|
@ -5,6 +5,7 @@
|
||||
"mainHeroTurnDistanceLimit" : 10,
|
||||
"scoutHeroTurnDistanceLimit" : 5,
|
||||
"maxGoldPressure" : 0.3,
|
||||
"updateHitmapOnTileReveal" : false,
|
||||
"useTroopsFromGarrisons" : true,
|
||||
"openMap": false,
|
||||
"allowObjectGraph": false,
|
||||
@ -22,6 +23,7 @@
|
||||
"mainHeroTurnDistanceLimit" : 10,
|
||||
"scoutHeroTurnDistanceLimit" : 5,
|
||||
"maxGoldPressure" : 0.3,
|
||||
"updateHitmapOnTileReveal" : false,
|
||||
"useTroopsFromGarrisons" : true,
|
||||
"openMap": false,
|
||||
"allowObjectGraph": false,
|
||||
@ -39,6 +41,7 @@
|
||||
"mainHeroTurnDistanceLimit" : 10,
|
||||
"scoutHeroTurnDistanceLimit" : 5,
|
||||
"maxGoldPressure" : 0.3,
|
||||
"updateHitmapOnTileReveal" : false,
|
||||
"useTroopsFromGarrisons" : true,
|
||||
"openMap": false,
|
||||
"allowObjectGraph": false,
|
||||
@ -56,6 +59,7 @@
|
||||
"mainHeroTurnDistanceLimit" : 10,
|
||||
"scoutHeroTurnDistanceLimit" : 5,
|
||||
"maxGoldPressure" : 0.3,
|
||||
"updateHitmapOnTileReveal" : false,
|
||||
"useTroopsFromGarrisons" : true,
|
||||
"openMap": true,
|
||||
"allowObjectGraph": false,
|
||||
@ -73,6 +77,7 @@
|
||||
"mainHeroTurnDistanceLimit" : 10,
|
||||
"scoutHeroTurnDistanceLimit" : 5,
|
||||
"maxGoldPressure" : 0.3,
|
||||
"updateHitmapOnTileReveal" : false,
|
||||
"useTroopsFromGarrisons" : true,
|
||||
"openMap": true,
|
||||
"allowObjectGraph": false,
|
||||
|
Loading…
Reference in New Issue
Block a user