mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
Another crash fix for land record without data
This commit is contained in:
parent
8eb1f4e70e
commit
f6509fe53e
2 changed files with 2 additions and 2 deletions
|
@ -78,7 +78,7 @@ CSVRender::Cell::Cell (CSMWorld::Data& data, Ogre::SceneManager *sceneManager,
|
||||||
if (landIndex != -1)
|
if (landIndex != -1)
|
||||||
{
|
{
|
||||||
const ESM::Land* esmLand = land.getRecord(mId).get().mLand.get();
|
const ESM::Land* esmLand = land.getRecord(mId).get().mLand.get();
|
||||||
if(esmLand)
|
if(esmLand && esmLand->mDataTypes&ESM::Land::DATA_VHGT)
|
||||||
{
|
{
|
||||||
mTerrain.reset(new Terrain::TerrainGrid(sceneManager, new TerrainStorage(mData), Element_Terrain, true,
|
mTerrain.reset(new Terrain::TerrainGrid(sceneManager, new TerrainStorage(mData), Element_Terrain, true,
|
||||||
Terrain::Align_XY));
|
Terrain::Align_XY));
|
||||||
|
|
|
@ -383,7 +383,7 @@ namespace ESMTerrain
|
||||||
int cellY = std::floor(worldPos.y / 8192.f);
|
int cellY = std::floor(worldPos.y / 8192.f);
|
||||||
|
|
||||||
ESM::Land* land = getLand(cellX, cellY);
|
ESM::Land* land = getLand(cellX, cellY);
|
||||||
if (!land)
|
if (!land || !(land->mDataTypes&ESM::Land::DATA_VHGT))
|
||||||
return -2048;
|
return -2048;
|
||||||
|
|
||||||
// Mostly lifted from Ogre::Terrain::getHeightAtTerrainPosition
|
// Mostly lifted from Ogre::Terrain::getHeightAtTerrainPosition
|
||||||
|
|
Loading…
Reference in a new issue