Skip to content

Commit 7bd2f73

Browse files
committed
Allow creatures' strength to be edited
1 parent 20f77ec commit 7bd2f73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/opencs/model/world/refidadapterimp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ QVariant CSMWorld::CreatureAttributesRefIdAdapter::getNestedData(
12871287

12881288
if (subColIndex == 0)
12891289
return subRowIndex;
1290-
else if (subColIndex == 1 && subRowIndex > 0 && subRowIndex < ESM::Attribute::Length)
1290+
else if (subColIndex == 1 && subRowIndex >= 0 && subRowIndex < ESM::Attribute::Length)
12911291
return creature.mData.mAttributes[subRowIndex];
12921292
return QVariant(); // throw an exception here?
12931293
}
@@ -1298,7 +1298,7 @@ void CSMWorld::CreatureAttributesRefIdAdapter::setNestedData(
12981298
Record<ESM::Creature>& record
12991299
= static_cast<Record<ESM::Creature>&>(data.getRecord(RefIdData::LocalIndex(row, UniversalId::Type_Creature)));
13001300

1301-
if (subColIndex == 1 && subRowIndex > 0 && subRowIndex < ESM::Attribute::Length)
1301+
if (subColIndex == 1 && subRowIndex >= 0 && subRowIndex < ESM::Attribute::Length)
13021302
{
13031303
ESM::Creature creature = record.get();
13041304
creature.mData.mAttributes[subRowIndex] = value.toInt();

0 commit comments

Comments
 (0)