mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Copy PathFinder::mPath back value when pass to MWMechanics::AiPackage::pathTo as dest
May become dangling reference because method may remove all elements from mPath.
This commit is contained in:
parent
60c7876c3d
commit
748f5225a9
@ -489,7 +489,7 @@ namespace MWMechanics
|
||||
float duration, AiWanderStorage& storage, ESM::Position& pos)
|
||||
{
|
||||
// Is there no destination or are we there yet?
|
||||
if ((!mPathFinder.isPathConstructed()) || pathTo(actor, mPathFinder.getPath().back(), duration, DESTINATION_TOLERANCE))
|
||||
if ((!mPathFinder.isPathConstructed()) || pathTo(actor, ESM::Pathgrid::Point(mPathFinder.getPath().back()), duration, DESTINATION_TOLERANCE))
|
||||
{
|
||||
stopWalking(actor, storage);
|
||||
storage.setState(Wander_ChooseAction);
|
||||
|
Loading…
x
Reference in New Issue
Block a user