CleverRaven/Cataclysm-DDA — pull request #7667 by kevingranade (2014-05-17 08:51:30+00:00)
Title: Fix float/int rounding bugs that were making layering too forgiving.

Turns out at least part of the layering issue was the fact that it has rounding errors.
This is how it's supposed to work, short version is the only way to wear two articles of clothing on the same body part / layer is if they started as 0 encumbrance AND they're now fitted. Also you can get away with two items that have 1 enc brought down to 0 with fitting on the torso only. If they have sleeves those will cause encumbrance on the arms.
This may or may not sort out the issue entirely, but I'd like to at least give it a shot working as intended before altering it further.
Note for working with floating point numbers, every time you cast to int it rounds DOWN, this includes if you do arithmetic with both floats and ints.