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:
@@ -618,7 +618,7 @@ really_kick_object(xchar x, xchar y)
|
||||
}
|
||||
|
||||
/* fragile objects should not be kicked */
|
||||
if (hero_breaks(g.kickedobj, g.kickedobj->ox, g.kickedobj->oy, FALSE))
|
||||
if (hero_breaks(g.kickedobj, g.kickedobj->ox, g.kickedobj->oy, 0))
|
||||
return 1;
|
||||
|
||||
/* too heavy to move. range is calculated as potential distance from
|
||||
|
||||
Reference in New Issue
Block a user