1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:23:54 +00:00

Merge pull request #1706 from akortunov/refidfix

Fix compiler warning in getNestedData()
This commit is contained in:
Bret Curtis 2018-05-16 09:00:25 +02:00 committed by GitHub
commit e410c47660
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1368,13 +1368,15 @@ QVariant CSMWorld::CreatureAttackRefIdAdapter::getNestedData (const RefIdColumn
const ESM::Creature& creature = record.get();
if (subRowIndex < 0 || subRowIndex > 2 || subColIndex < 0 || subColIndex > 2)
if (subRowIndex < 0 || subRowIndex > 2)
throw std::runtime_error ("index out of range");
if (subColIndex == 0)
return subRowIndex + 1;
else if (subColIndex < 3) // 1 or 2
else if (subColIndex == 1 || subColIndex == 2)
return creature.mData.mAttack[(subRowIndex * 2) + (subColIndex - 1)];
else
throw std::runtime_error ("index out of range");
}
void CSMWorld::CreatureAttackRefIdAdapter::setNestedData (const RefIdColumn *column,