From 7d703a13a3024e2428928fb34f246cc3838d4fa7 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 24 Sep 2017 16:28:05 +0400 Subject: [PATCH] Fix a crash in the World::isUnderwater() if the cell is empty --- apps/openmw/mwworld/worldimp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 40bc13c94..2a25d5bbc 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2123,6 +2123,9 @@ namespace MWWorld bool World::isUnderwater(const MWWorld::CellStore* cell, const osg::Vec3f &pos) const { + if (!cell) + return false; + if (!(cell->getCell()->hasWater())) { return false; }