breaking wielded fragile item against iron bars

Reported by entrez, wielding something fragile (potion of acid
perhaps), and using F to smash it against iron bars called breaktest()
directly, then a second time indirectly through hero_breaks() via
hit_bars().  There is a random chance to resist breaking (99% for
artifacts, 1% for other items) so breaktest() might say that something
will break on the first call and that it will not break on the second
call, or vice versa.  That could remove uwep from inventory then leave
it in limbo without destroying it, or destroy uwep without removing it
from inventory first triggering impossible "obfree: deleting worn obj".
This commit is contained in:
PatR
2021-10-22 19:11:51 -07:00
parent 56f79dd207
commit 37e63f6829
8 changed files with 97 additions and 61 deletions

View File

@@ -655,6 +655,9 @@ if vault guard arrives on a boulder in a breach in the vault wall when coming
when vault walls are repaired, destroy any rocks or boulders at their spots
melting ice timer could persist after the ice was gone from digging or from an
exploding land mine
using 'F'orcefight against iron bars while wielding something breakable could
yield erratic outcome because non-deterministic breaktest() was being
called twice and could yield results that conflicted
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository