1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-20 15:40:32 +00:00

Allow travelling actors find path over pathgrid navmesh area type

In addition to other navmesh areas. This makes actors behaviour closer to
vanilla when pathgrid is correct.
This commit is contained in:
elsid 2021-09-28 23:16:56 +02:00
parent 163968f578
commit 9950132a5f
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40
2 changed files with 5 additions and 1 deletions

View File

@ -443,7 +443,11 @@ DetourNavigator::Flags MWMechanics::AiPackage::getNavigatorFlags(const MWWorld::
result |= DetourNavigator::Flag_swim;
if (actorClass.canWalk(actor) && actor.getClass().getWalkSpeed(actor) > 0)
{
result |= DetourNavigator::Flag_walk;
if (getTypeId() == AiPackageTypeId::Travel)
result |= DetourNavigator::Flag_usePathgrid;
}
if (actorClass.isBipedal(actor) && getTypeId() != AiPackageTypeId::Wander)
result |= DetourNavigator::Flag_openDoor;

View File

@ -397,7 +397,7 @@ namespace MWMechanics
mPath.clear();
}
if (status != DetourNavigator::Status::NavMeshNotFound && mPath.empty())
if (status != DetourNavigator::Status::NavMeshNotFound && mPath.empty() && (flags & DetourNavigator::Flag_usePathgrid) == 0)
{
status = buildPathByNavigatorImpl(actor, startPoint, endPoint, halfExtents,
flags | DetourNavigator::Flag_usePathgrid, areaCosts, endTolerance, pathType, std::back_inserter(mPath));