1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 13:09:42 +00:00

Reset shorcutting if actor can't move by z-axis on reaction time

If actor was shortcutting because it was swimming, then when it started
walking it still be shortcutting, but there will be no new path, because
shortcut path builds only for actor able moving by z-axis and pathfinder
path only for not shortcutting actor.
This commit is contained in:
elsid 2018-09-08 14:30:03 +03:00
parent 92b34e8bb4
commit 7c5bedc35a
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -132,8 +132,8 @@ bool MWMechanics::AiPackage::pathTo(const MWWorld::Ptr& actor, const osg::Vec3f&
const bool actorCanMoveByZ = canActorMoveByZAxis(actor);
// Prohibit shortcuts for AiWander, if the actor can not move in 3 dimensions.
if (actorCanMoveByZ)
mIsShortcutting = shortcutPath(position, dest, actor, &destInLOS, actorCanMoveByZ); // try to shortcut first
mIsShortcutting = actorCanMoveByZ
&& shortcutPath(position, dest, actor, &destInLOS, actorCanMoveByZ); // try to shortcut first
if (!mIsShortcutting)
{