From 7bd2f73fe57102575e155ab5fb165f7d9c761d97 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 7 Nov 2024 17:12:00 +0100 Subject: [PATCH] Allow creatures' strength to be edited --- apps/opencs/model/world/refidadapterimp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/world/refidadapterimp.cpp b/apps/opencs/model/world/refidadapterimp.cpp index e7d6eb0c1c5..a6ea56a56d4 100644 --- a/apps/opencs/model/world/refidadapterimp.cpp +++ b/apps/opencs/model/world/refidadapterimp.cpp @@ -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? } @@ -1298,7 +1298,7 @@ void CSMWorld::CreatureAttributesRefIdAdapter::setNestedData( Record& record = static_cast&>(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();