Thread:FixSRwiki/@comment-46261745-20201012171553/@comment-26544499-20201025135537

Easily done, don't worry about it!

You're probably right about the logic in tagBattleBar::calcBarSize. Algebraically speaking, I can see that if nMax>0 then nW1 and nW2 will be set such that nW1+nw2 = 400*(nValue1+nValue2)/nMax = 400*nMax/nMax = 400 and I can also see that if nMax<=0 then nW1+nW2 is trivially 400. But, as you point out, we actually need a rounding clause because this is integer division rather than nice and clean algebra. This is the purpose of the if(nW1 + nW2 < 400) branch, although I really don't see why its else branch changes nW2 and then never uses it.

nW1 isn't a ratio out of 400. Your own example proves that. You could convert 281/400 in to a ratio, but 281 is in of itself no a ratio. I've also got no idea where the animations are actually done, so I don't know how nW1 is actually used.

nValues 1 and 2 are forced to have a minimum value of 0, so I can't see any way to nW1 or nW2 take a value that isn't an integer in the [0,400] range, but I can't go as far as to say that the bar itself caps out at 400.