1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

AI: stability fixes

This commit is contained in:
Andrii Danylchenko
2019-01-26 22:38:57 +02:00
parent ccd416908e
commit bf87a9774d
3 changed files with 14 additions and 4 deletions

View File

@@ -300,10 +300,9 @@ namespace AIPathfinding
if(blocker == BlockingReason::DESTINATION_BLOCKVIS && destination.nodeObject)
{
auto objID = destination.nodeObject->ID;
if((objID == Obj::HERO && destination.objectRelations != PlayerRelations::ENEMIES)
|| objID == Obj::SUBTERRANEAN_GATE || objID == Obj::MONOLITH_TWO_WAY
|| objID == Obj::MONOLITH_ONE_WAY_ENTRANCE || objID == Obj::MONOLITH_ONE_WAY_EXIT
|| objID == Obj::WHIRLPOOL)
auto enemyHero = objID == Obj::HERO && destination.objectRelations == PlayerRelations::ENEMIES;
if(!enemyHero && !isObjectRemovable(destination.nodeObject))
{
destination.blocked = true;
}