mirror of
https://github.com/OpenMW/openmw.git
synced 2026-01-03 07:43:10 +00:00
Merge branch 'thewayisshut' into 'master'
Check for nullptr before dereferencing pathgrids Closes #8663 See merge request OpenMW/openmw!4849
This commit is contained in:
commit
601b4cb6b1
1 changed files with 6 additions and 0 deletions
|
|
@ -636,6 +636,12 @@ namespace MWMechanics
|
|||
|
||||
const MWWorld::Cell& cell = *actor.getCell()->getCell();
|
||||
const ESM::Pathgrid* pathgrid = world.getStore().get<ESM::Pathgrid>().search(cell);
|
||||
// Moved to a cell without a pathgrid
|
||||
if (pathgrid == nullptr || pathgrid->mPoints.size() < 2)
|
||||
{
|
||||
storage.mAllowedPositions.clear();
|
||||
return;
|
||||
}
|
||||
const PathgridGraph& pathgridGraph = getPathGridGraph(pathgrid);
|
||||
|
||||
const Misc::CoordinateConverter converter = Misc::makeCoordinateConverter(cell);
|
||||
|
|
|
|||
Loading…
Reference in a new issue