diff --git a/doc/fixes36.2 b/doc/fixes36.2 index a4c3a8f09..d4fbba9f2 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -60,6 +60,8 @@ make stone-to-flesh behave the same on statues of petrified monsters as it becoming a corpse when there's already a monster at statue's location) special level loader didn't support populating several types of special rooms (ant hole, cockatrice nest, leprechaun hall) +eating rings while polymorphed didn't handle bonus/penalty for increase damage, + increase accuracy, or protection correctly Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/eat.c b/src/eat.c index 79fd56df0..1c055abbc 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1877,10 +1877,11 @@ int old, inc, typ; { int absold, absinc, sgnold, sgninc; - /* don't include any amount coming from worn rings */ - if (uright && uright->otyp == typ) + /* don't include any amount coming from worn rings (caller handles + 'protection' differently) */ + if (uright && uright->otyp == typ && typ != RIN_PROTECTION) old -= uright->spe; - if (uleft && uleft->otyp == typ) + if (uleft && uleft->otyp == typ && typ != RIN_PROTECTION) old -= uleft->spe; absold = abs(old), absinc = abs(inc); sgnold = sgn(old), sgninc = sgn(inc); @@ -1900,6 +1901,11 @@ int old, inc, typ; } else { inc = 0; /* no further increase allowed via this method */ } + /* put amount from worn rings back */ + if (uright && uright->otyp == typ && typ != RIN_PROTECTION) + old += uright->spe; + if (uleft && uleft->otyp == typ && typ != RIN_PROTECTION) + old += uleft->spe; return old + inc; } @@ -1908,7 +1914,7 @@ accessory_has_effect(otmp) struct obj *otmp; { pline("Magic spreads through your body as you digest the %s.", - otmp->oclass == RING_CLASS ? "ring" : "amulet"); + (otmp->oclass == RING_CLASS) ? "ring" : "amulet"); } STATIC_OVL void