[BUG] Spells reduce stats

From: flawed (flawed@io.com)
Date: 10/19/01


I've been having a problem where stats over 18  get reduced to 18
regardless of what spell was cast on them.  I decided to see if this was
on my end, or circlmuds end. I downloaded a stock bpl19, made an imm,
checked to be sure every stat was 25. Upon casting sanctuary, all his
statsare reduced to 18. Allowing the spell duration to wear off, does not
restore the lost stats as well.

Awhile ago this brought up, and a partial fix was posted, but Im not sure
if people noticed this being a stock bug or not.

Fix by:
Juliano Ravasi Ferraz <jferraz@linkway.com.br>

In handler.c, affect_total():

--<snip>--
    for (af = ch->affected; af; af = af->next)
      affect_modify(ch, af->location, af->modifier, af->bitvector,TRUE);

    /* Make certain values are between 0..25, not < 0 and not > 25! */

-   i = (IS_NPC(ch) ? 25 : 18);
+   i = (IS_NPC(ch) || (GET_LEVEL(ch) >= LVL_GRGOD) ? 25 : 18);

+   GET_CHA(ch) = MAX(0, MIN(GET_CHA(ch), i));
    GET_DEX(ch) = MAX(0, MIN(GET_DEX(ch), i));
    GET_INT(ch) = MAX(0, MIN(GET_INT(ch), i));
    GET_WIS(ch) = MAX(0, MIN(GET_WIS(ch), i));
    GET_CON(ch) = MAX(0, MIN(GET_CON(ch), i));
    GET_STR(ch) = MAX(0, GET_STR(ch));

    if (IS_NPC(ch)) {
      GET_STR(ch) = MIN(GET_STR(ch), i);
--<snip>--

This will fix most of the problem, but it still leaves strength as being
18. Does anyone have ideas as to how to fix this?

Matt Kuebbeler

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST