From 23d917df9c48fd1616037ac1cade28d639480d32 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 26 Jul 2018 18:06:36 +0400 Subject: [PATCH] Do not use magic numbers in capacity calculations --- apps/openmw/mwclass/creature.cpp | 2 +- apps/openmw/mwclass/npc.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index be143bb46..02a8a17ef 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -614,7 +614,7 @@ namespace MWClass float Creature::getCapacity (const MWWorld::Ptr& ptr) const { const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); - return static_cast(stats.getAttribute(0).getModified() * 5); + return static_cast(stats.getAttribute(ESM::Attribute::Strength).getModified() * 5); } int Creature::getServices(const MWWorld::ConstPtr &actor) const diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index b08542e67..1c293f1e4 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -1079,7 +1079,7 @@ namespace MWClass { const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); static const float fEncumbranceStrMult = MWBase::Environment::get().getWorld()->getStore().get().find("fEncumbranceStrMult")->getFloat(); - return stats.getAttribute(0).getModified()*fEncumbranceStrMult; + return stats.getAttribute(ESM::Attribute::Strength).getModified()*fEncumbranceStrMult; } float Npc::getEncumbrance (const MWWorld::Ptr& ptr) const