mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-12 04:14:05 +00:00
Make 0/0 encumbrance 0% encumbrance
This commit is contained in:
parent
ba077e7291
commit
409d466e42
@ -462,10 +462,15 @@ namespace MWWorld
|
||||
float Class::getNormalizedEncumbrance(const Ptr &ptr) const
|
||||
{
|
||||
float capacity = getCapacity(ptr);
|
||||
float encumbrance = getEncumbrance(ptr);
|
||||
|
||||
if (encumbrance == 0)
|
||||
return 0.f;
|
||||
|
||||
if (capacity == 0)
|
||||
return 1.f;
|
||||
|
||||
return getEncumbrance(ptr) / capacity;
|
||||
return encumbrance / capacity;
|
||||
}
|
||||
|
||||
std::string Class::getSound(const MWWorld::ConstPtr&) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user