Correction of partial damage resist calculation

Here's my new correction for this code.
Take it or not as you want, I only want to contribute and give you debugs because of open source mind, I'm not here to fight neither to taunt you on your mistakes.

The fact is I spent last 4 days correcting a code that worked when I gave it to you. If you need explanations on my code I'll be glad to explain whatever you want, but I really think that seeing my code modified for a bugged one, and spending so much time and energy on debugging, re-debugging (with number of tests each time), and fighting is time and energy I could spend somewhere else.

So if you keep adding bug on this one without asking, without taking comments in consideration, I'll not fight again, at least I know it will work on the private server I'm on ^^

Don't misunderstand me, I think that the work on cleaning the code was very good, that's not what I'm talking about.