mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:53:52 +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
This commit is contained in:
commit
baa33799de
2 changed files with 4 additions and 1 deletions
|
@ -348,7 +348,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
bool runFallback = true;
|
bool runFallback = true;
|
||||||
|
|
||||||
if (pathgrid && !actor.getClass().isPureWaterCreature(actor))
|
if (pathgrid != nullptr && !pathgrid->mPoints.empty() && !actor.getClass().isPureWaterCreature(actor))
|
||||||
{
|
{
|
||||||
ESM::Pathgrid::PointList points;
|
ESM::Pathgrid::PointList points;
|
||||||
Misc::CoordinateConverter coords(storage.mCell->getCell());
|
Misc::CoordinateConverter coords(storage.mCell->getCell());
|
||||||
|
|
|
@ -758,6 +758,9 @@ namespace MWMechanics
|
||||||
const ESM::Pathgrid *pathgrid =
|
const ESM::Pathgrid *pathgrid =
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Pathgrid>().search(*currentCell->getCell());
|
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));
|
int index = PathFinder::getClosestPoint(pathgrid, PathFinder::makeOsgVec3(dest));
|
||||||
|
|
||||||
getPathGridGraph(currentCell).getNeighbouringPoints(index, points);
|
getPathGridGraph(currentCell).getNeighbouringPoints(index, points);
|
||||||
|
|
Loading…
Reference in a new issue