mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-05 19:19:44 +00:00
Merge branch 'check_pathgrid' into 'master'
Make sure PathFinder::getClosestPoint is not called with failing precondition (#6294) Closes #6294 See merge request OpenMW/openmw!1236 (cherry picked from commit baa33799de3cb27d9d3805e164b9d7ccea6a3e4d) d36595e0 Make sure PathFinder::getClosestPoint is not called with failing precondition
This commit is contained in:
parent
56869ec296
commit
f0a77a48df
2 changed files with 4 additions and 1 deletions
|
@ -346,7 +346,7 @@ namespace MWMechanics
|
|||
|
||||
bool runFallback = true;
|
||||
|
||||
if (pathgrid && !actor.getClass().isPureWaterCreature(actor))
|
||||
if (pathgrid != nullptr && !pathgrid->mPoints.empty() && !actor.getClass().isPureWaterCreature(actor))
|
||||
{
|
||||
ESM::Pathgrid::PointList points;
|
||||
Misc::CoordinateConverter coords(storage.mCell->getCell());
|
||||
|
|
|
@ -754,6 +754,9 @@ namespace MWMechanics
|
|||
const ESM::Pathgrid *pathgrid =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Pathgrid>().search(*currentCell->getCell());
|
||||
|
||||
if (pathgrid == nullptr || pathgrid->mPoints.empty())
|
||||
return;
|
||||
|
||||
int index = PathFinder::getClosestPoint(pathgrid, PathFinder::makeOsgVec3(dest));
|
||||
|
||||
getPathGridGraph(currentCell).getNeighbouringPoints(index, points);
|
||||
|
|
Loading…
Reference in a new issue