mirror of
https://github.com/OpenMW/openmw.git
synced 2026-01-06 10:41:04 +00:00
Check for nullptr before dereferencing pathgrids
This commit is contained in:
parent
f5d866894e
commit
4707d7602d
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)
|
||||
{
|
||||
storage.mAllowedPositions.clear();
|
||||
return;
|
||||
}
|
||||
const PathgridGraph& pathgridGraph = getPathGridGraph(pathgrid);
|
||||
|
||||
const Misc::CoordinateConverter converter = Misc::makeCoordinateConverter(cell);
|
||||
|
|
|
|||
Loading…
Reference in a new issue