Skip to content

Commit

Permalink
Allow creatures' strength to be edited
Browse files Browse the repository at this point in the history
  • Loading branch information
Assumeru committed Nov 7, 2024
1 parent 20f77ec commit 7bd2f73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/opencs/model/world/refidadapterimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ QVariant CSMWorld::CreatureAttributesRefIdAdapter::getNestedData(

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

if (subColIndex == 1 && subRowIndex > 0 && subRowIndex < ESM::Attribute::Length)
if (subColIndex == 1 && subRowIndex >= 0 && subRowIndex < ESM::Attribute::Length)
{
ESM::Creature creature = record.get();
creature.mData.mAttributes[subRowIndex] = value.toInt();
Expand Down

0 comments on commit 7bd2f73

Please sign in to comment.