forked from mirror/openmw-tes3mp
Fix compiler warning in getNestedData
This commit is contained in:
parent
3197ebd8e7
commit
6a3ff5ed81
1 changed files with 4 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue