1
0
Fork 0
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:
Alexei Kotov 2025-08-22 07:57:14 +03:00
commit 601b4cb6b1

View file

@ -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);