check for land index not -1, fix warning

Signed-off-by: Sam Hellawell <sshellawell@gmail.com>
fix-osga-rotate-wildly
Sam Hellawell 10 months ago
parent 5fca45565c
commit a62da201e5

@ -29,9 +29,11 @@ namespace CSMWorld
{
const IdCollection<Land>& lands = data.getLand();
int landIndex = lands.searchId(cell.mId);
const Land& land = lands.getRecord(landIndex).get();
if (landIndex == -1)
return 0.0f;
// If any part of land is above water, returns > 0 - otherwise returns < 0
const Land& land = lands.getRecord(landIndex).get();
if (land.getLandData())
return land.getLandData()->mMaxHeight - cell.mWater;

@ -364,7 +364,6 @@ std::vector<CSMWorld::UniversalId> CSVWorld::RegionMap::getDraggedRecords() cons
void CSVWorld::RegionMap::dragMoveEvent(QDragMoveEvent* event)
{
QModelIndex index = indexAt(event->pos());
const CSMWorld::TableMimeData* mime = dynamic_cast<const CSMWorld::TableMimeData*>(event->mimeData());
if (mime != nullptr && (mime->holdsType(CSMWorld::UniversalId::Type_Region)))
{

Loading…
Cancel
Save