mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-03 23:36:59 -04:00
Use walking speed for swimming actor with water walking for pathfinding
This will make them find shorter paths nearby shores.
This commit is contained in:
parent
b4971b6841
commit
594bd6e136
@ -121,6 +121,7 @@
|
|||||||
Bug #7723: Assaulting vampires and werewolves shouldn't be a crime
|
Bug #7723: Assaulting vampires and werewolves shouldn't be a crime
|
||||||
Bug #7724: Guards don't help vs werewolves
|
Bug #7724: Guards don't help vs werewolves
|
||||||
Bug #7742: Governing attribute training limit should use the modified attribute
|
Bug #7742: Governing attribute training limit should use the modified attribute
|
||||||
|
Bug #7758: Water walking is not taken into account to compute path cost on the water
|
||||||
Feature #2566: Handle NAM9 records for manual cell references
|
Feature #2566: Handle NAM9 records for manual cell references
|
||||||
Feature #3537: Shader-based water ripples
|
Feature #3537: Shader-based water ripples
|
||||||
Feature #5173: Support for NiFogProperty
|
Feature #5173: Support for NiFogProperty
|
||||||
|
@ -492,8 +492,6 @@ DetourNavigator::AreaCosts MWMechanics::AiPackage::getAreaCosts(const MWWorld::P
|
|||||||
const DetourNavigator::Flags flags = getNavigatorFlags(actor);
|
const DetourNavigator::Flags flags = getNavigatorFlags(actor);
|
||||||
const MWWorld::Class& actorClass = actor.getClass();
|
const MWWorld::Class& actorClass = actor.getClass();
|
||||||
|
|
||||||
const float swimSpeed = (flags & DetourNavigator::Flag_swim) == 0 ? 0.0f : actorClass.getSwimSpeed(actor);
|
|
||||||
|
|
||||||
const float walkSpeed = [&] {
|
const float walkSpeed = [&] {
|
||||||
if ((flags & DetourNavigator::Flag_walk) == 0)
|
if ((flags & DetourNavigator::Flag_walk) == 0)
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
@ -502,6 +500,14 @@ DetourNavigator::AreaCosts MWMechanics::AiPackage::getAreaCosts(const MWWorld::P
|
|||||||
return actorClass.getRunSpeed(actor);
|
return actorClass.getRunSpeed(actor);
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
const float swimSpeed = [&] {
|
||||||
|
if ((flags & DetourNavigator::Flag_swim) == 0)
|
||||||
|
return 0.0f;
|
||||||
|
if (hasWaterWalking(actor))
|
||||||
|
return walkSpeed;
|
||||||
|
return actorClass.getSwimSpeed(actor);
|
||||||
|
}();
|
||||||
|
|
||||||
const float maxSpeed = std::max(swimSpeed, walkSpeed);
|
const float maxSpeed = std::max(swimSpeed, walkSpeed);
|
||||||
|
|
||||||
if (maxSpeed == 0)
|
if (maxSpeed == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user