Acid damage of inventory items broken
|Reported by:||takkaria||Owned by:|
In the original code, inven_damage() was called with an argument "perc" that was set to either 1, 2, or 3. In the code, this number was multiplied by 100, then divided by 4 for rods, and then compared to rand_int(10000) to get a chance of destruction of either 1, 2, or 3, or (for rods) 1/4, 1/2, or 3/4 percent. The multiplication by 100 and the test against rand_int(10000) were introduced to prevent rounding errors in the division by 4 when Robert added the extra resistance for rods.
The code to damage instead of destroy weapons and armour was inserted after the multiplication by 100, but the chance (which by now is one of 100, 200, or 300) is tested against rand_int(100) instead of rand_int(10000). I didn't playtest it - but unless I'm very much mistaken, damaging attacks should now ALWAYS succeed in damaging susceptible items.