1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

Make 0/0 encumbrance 0% encumbrance

This commit is contained in:
Capostrophic 2018-05-12 20:50:18 +03:00 committed by Capostrophic
parent ba077e7291
commit 409d466e42

View file

@ -462,10 +462,15 @@ namespace MWWorld
float Class::getNormalizedEncumbrance(const Ptr &ptr) const float Class::getNormalizedEncumbrance(const Ptr &ptr) const
{ {
float capacity = getCapacity(ptr); float capacity = getCapacity(ptr);
float encumbrance = getEncumbrance(ptr);
if (encumbrance == 0)
return 0.f;
if (capacity == 0) if (capacity == 0)
return 1.f; return 1.f;
return getEncumbrance(ptr) / capacity; return encumbrance / capacity;
} }
std::string Class::getSound(const MWWorld::ConstPtr&) const std::string Class::getSound(const MWWorld::ConstPtr&) const