mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-24 04:11:50 -04:00
Check for nullptr before dereferencing pathgrids
This commit is contained in:
parent
f5d866894e
commit
4707d7602d
@ -636,6 +636,12 @@ namespace MWMechanics
|
|||||||
|
|
||||||
const MWWorld::Cell& cell = *actor.getCell()->getCell();
|
const MWWorld::Cell& cell = *actor.getCell()->getCell();
|
||||||
const ESM::Pathgrid* pathgrid = world.getStore().get<ESM::Pathgrid>().search(cell);
|
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 PathgridGraph& pathgridGraph = getPathGridGraph(pathgrid);
|
||||||
|
|
||||||
const Misc::CoordinateConverter converter = Misc::makeCoordinateConverter(cell);
|
const Misc::CoordinateConverter converter = Misc::makeCoordinateConverter(cell);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user