Add walk and swim flags when corresponding speed is positive

This allows to avoid finding path over area that will should have infinite
cost (area_cost = area_cost_factor / area_speed).
pull/593/head
elsid 4 years ago
parent 3c4a9069ae
commit 0fae6d9a0a
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -424,14 +424,15 @@ DetourNavigator::Flags MWMechanics::AiPackage::getNavigatorFlags(const MWWorld::
const MWWorld::Class& actorClass = actor.getClass();
DetourNavigator::Flags result = DetourNavigator::Flag_none;
if (actorClass.isPureWaterCreature(actor)
|| (getTypeId() != AiPackageTypeId::Wander
&& ((allowToFollowOverWaterSurface && getTypeId() == AiPackageTypeId::Follow)
|| actorClass.canSwim(actor)
|| hasWaterWalking(actor))))
if ((actorClass.isPureWaterCreature(actor)
|| (getTypeId() != AiPackageTypeId::Wander
&& ((allowToFollowOverWaterSurface && getTypeId() == AiPackageTypeId::Follow)
|| actorClass.canSwim(actor)
|| hasWaterWalking(actor)))
) && actorClass.getSwimSpeed(actor) > 0)
result |= DetourNavigator::Flag_swim;
if (actorClass.canWalk(actor))
if (actorClass.canWalk(actor) && actor.getClass().getWalkSpeed(actor) > 0)
result |= DetourNavigator::Flag_walk;
if (actorClass.isBipedal(actor) && getTypeId() != AiPackageTypeId::Wander)

Loading…
Cancel
Save