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.
pull/541/head
elsid 6 years ago
parent 92b34e8bb4
commit 7c5bedc35a
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -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)
{

Loading…
Cancel
Save