mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 13:23:52 +00:00
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).
This commit is contained in:
parent
3c4a9069ae
commit
0fae6d9a0a
1 changed files with 7 additions and 6 deletions
|
@ -424,14 +424,15 @@ DetourNavigator::Flags MWMechanics::AiPackage::getNavigatorFlags(const MWWorld::
|
||||||
const MWWorld::Class& actorClass = actor.getClass();
|
const MWWorld::Class& actorClass = actor.getClass();
|
||||||
DetourNavigator::Flags result = DetourNavigator::Flag_none;
|
DetourNavigator::Flags result = DetourNavigator::Flag_none;
|
||||||
|
|
||||||
if (actorClass.isPureWaterCreature(actor)
|
if ((actorClass.isPureWaterCreature(actor)
|
||||||
|| (getTypeId() != AiPackageTypeId::Wander
|
|| (getTypeId() != AiPackageTypeId::Wander
|
||||||
&& ((allowToFollowOverWaterSurface && getTypeId() == AiPackageTypeId::Follow)
|
&& ((allowToFollowOverWaterSurface && getTypeId() == AiPackageTypeId::Follow)
|
||||||
|| actorClass.canSwim(actor)
|
|| actorClass.canSwim(actor)
|
||||||
|| hasWaterWalking(actor))))
|
|| hasWaterWalking(actor)))
|
||||||
|
) && actorClass.getSwimSpeed(actor) > 0)
|
||||||
result |= DetourNavigator::Flag_swim;
|
result |= DetourNavigator::Flag_swim;
|
||||||
|
|
||||||
if (actorClass.canWalk(actor))
|
if (actorClass.canWalk(actor) && actor.getClass().getWalkSpeed(actor) > 0)
|
||||||
result |= DetourNavigator::Flag_walk;
|
result |= DetourNavigator::Flag_walk;
|
||||||
|
|
||||||
if (actorClass.isBipedal(actor) && getTypeId() != AiPackageTypeId::Wander)
|
if (actorClass.isBipedal(actor) && getTypeId() != AiPackageTypeId::Wander)
|
||||||
|
|
Loading…
Reference in a new issue