Fix compiler warning in getNestedData

This commit is contained in:
Andrei Kortunov 2018-05-16 10:10:42 +04:00
parent 3197ebd8e7
commit 6a3ff5ed81

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,