Opened 13 years ago

Closed 13 years ago

#251 closed bug (fixed (in master))

Acid damage of inventory items broken

Reported by: takkaria Owned by:
Milestone: 3.0.9 Keywords:



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.

Change History (1)

comment:1 Changed 13 years ago by ajps

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [362] merged in [5dfe994] (SVN r399).

Note: See TracTickets for help on using tickets.