1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-01 04:20:20 +00:00

Cleanup(CSVRender::Cell:updateLand): Early exit when landscape should

not be loaded
This commit is contained in:
Dave Corley 2023-12-09 11:53:18 -06:00
parent 78fd135764
commit dd7a2f22d1

View File

@ -133,8 +133,10 @@ void CSVRender::Cell::updateLand()
// Setup land if available // Setup land if available
const CSMWorld::IdCollection<CSMWorld::Land>& land = mData.getLand(); const CSMWorld::IdCollection<CSMWorld::Land>& land = mData.getLand();
int landIndex = land.searchId(mId); int landIndex = land.searchId(mId);
if (landIndex != -1 && !land.getRecord(mId).isDeleted())
{ if (landIndex == -1 || land.getRecord(mId).isDeleted())
return;
const ESM::Land& esmLand = land.getRecord(mId).get(); const ESM::Land& esmLand = land.getRecord(mId).get();
if (!esmLand.getLandData(ESM::Land::DATA_VHGT)) if (!esmLand.getLandData(ESM::Land::DATA_VHGT))
@ -158,7 +160,6 @@ void CSVRender::Cell::updateLand()
mCellBorder = std::make_unique<CellBorder>(mCellNode, mCoordinates); mCellBorder = std::make_unique<CellBorder>(mCellNode, mCoordinates);
mCellBorder->buildShape(esmLand); mCellBorder->buildShape(esmLand);
}
} }
void CSVRender::Cell::unloadLand() void CSVRender::Cell::unloadLand()