Skip to content

Floating point imprecision can mess with container capacity

  • OS: Windows 10
  • OpenMW Version: 0.49.0
  • Morrowind Version: Steam - Tribunal, Bloodmoon
  • Also occurs in a clean vanilla OpenMW install.
    • Not sure if it happens in vanilla Morrowind.

Video show casing the issue: I use items that are weighed just 0.1.

Container_Capacity_Check_-oo

If I try to put 4 of these items in the container at once, it rejects it. But if I put just 3 in first, and then put 1 in, it goes in. If 4 of these items can't fit, then that last one shouldn't be able to go in and yet it does.

In the second half of the video, I've shown notifications that list the container's capacity, encumbrance and remaining space during each one of these steps. (I used Lua API (Container.getCapacity() and Container.getEncumbrance()) to get the values).

Probably due to floating point imprecision and/or rounding error?