mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
check for land index not -1, fix warning
Signed-off-by: Sam Hellawell <sshellawell@gmail.com>
This commit is contained in:
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…
Reference in New Issue
Block a user