Add setting to allow following creatures to find path over water surface

pull/3065/head
elsid 4 years ago
parent 8766b81cf8
commit 634556be9d
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -108,6 +108,7 @@ bool Launcher::AdvancedPage::loadSettings()
int numPhysicsThreads = mEngineSettings.getInt("async num threads", "Physics");
if (numPhysicsThreads >= 0)
physicsThreadsSpinBox->setValue(numPhysicsThreads);
loadSettingBool(allowNPCToFollowOverWaterSurfaceCheckBox, "allow actors to follow over water surface", "Game");
}
// Visuals

@ -411,10 +411,15 @@ bool MWMechanics::AiPackage::isReachableRotatingOnTheRun(const MWWorld::Ptr& act
DetourNavigator::Flags MWMechanics::AiPackage::getNavigatorFlags(const MWWorld::Ptr& actor) const
{
static const bool allowToFollowOverWaterSurface = Settings::Manager::getBool("allow actors to follow over water surface", "Game");
const MWWorld::Class& actorClass = actor.getClass();
DetourNavigator::Flags result = DetourNavigator::Flag_none;
if (actorClass.isPureWaterCreature(actor) || (getTypeId() != AiPackageTypeId::Wander && actorClass.canSwim(actor)))
if (actorClass.isPureWaterCreature(actor)
|| (getTypeId() != AiPackageTypeId::Wander
&& ((allowToFollowOverWaterSurface && getTypeId() == AiPackageTypeId::Follow)
|| actorClass.canSwim(actor))))
result |= DetourNavigator::Flag_swim;
if (actorClass.canWalk(actor))

@ -439,3 +439,19 @@ graphic herbalism
Some mods add harvestable container models. When this setting is enabled, activating a container using a harvestable model will visually harvest from it instead of opening the menu.
When this setting is turned off or when activating a regular container, the menu will open as usual.
allow actors to follow over water surface
---------------------
:Type: boolean
:Range: True/False
:Default: True
If enabled actors will always find path over the water surface when following other actors. This makes OpenMW behaviour closer to the vanilla engine.
If disabled actors without the ability to swim will not follow other actors to the water.
.. note::
Has effect only when Navigator is enabled.
This setting can be controlled in Advanced tab of the launcher.

@ -364,6 +364,10 @@ always allow stealing from knocked out actors = false
# Enables visually harvesting plants for models that support it.
graphic herbalism = true
# Give actors an ability to swim over water surface when they follow other actor independently from their ability to swim
# (true, false)
allow actors to follow over water surface = true
[General]
# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16).

@ -153,6 +153,16 @@
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="allowNPCToFollowOverWaterSurfaceCheckBox">
<property name="toolTip">
<string>Give NPC an ability to swim over the water surface when they follow other actor independently from their ability to swim. Has effect only when nav mesh building is enabled.</string>
</property>
<property name="text">
<string>Always allow NPC to follow over water surface</string>
</property>
</widget>
</item>
</layout>
</item>
<item>

Loading…
Cancel
Save