Skip to content

Commit

Permalink
Fix: metallivore eating ball/chain and not consuming it
Browse files Browse the repository at this point in the history
Leading to a panic when it was still considered attached to the hero but
present in the monster's stomach. Unconditionally destroy the ball or
chain if a metallivore eats it. (Another slightly more complex solution
would have been to let them store it in their stomach and just clear
uball/uchain, but this is probably a fringe case anyway.)
  • Loading branch information
copperwater committed May 23, 2023
1 parent 42ba61d commit 0314561
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,8 @@ meatmetal(struct monst *mtmp)
* special effects happened - but it would require cascading
* refactors to make m_consume_obj and mon_givit, etc return
* booleans, which is more trouble than it's worth right now. */
if (otmp->otyp == TIN || !rn2(7))
if (otmp == uball || otmp == uchain
|| otmp->otyp == TIN || !rn2(7))
m_consume_obj(mtmp, otmp);
else {
obj_extract_self(otmp);
Expand Down

0 comments on commit 0314561

Please sign in to comment.