mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Make 0/0 encumbrance 0% encumbrance
This commit is contained in:
parent
ba077e7291
commit
409d466e42
1 changed files with 6 additions and 1 deletions
|
@ -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…
Reference in a new issue