[CODE] Spell Problem

From: Mark Seelenbacher (seelenbacher@nc.rr.com)
Date: 04/28/01


Hi all-

I changed my mud so that when a player dies they're given three ticks
before they "corpse".  I added 'raise dead' and 'resurrect' spells (using a
spell template) to the mud and changed the heal code so that it won't work
for a dead player.  The following is the code from spell_parser.c &
magic.c:

In spell_parser.c:
   /* If a player is dead, make sure they can't be healed */
   if (!IS_NPC(tch) && GET_POS(tch) == POS_DEAD && IS_SET(SINFO.routines,
MAG_POINTS)) {
    send_to_char("They're beyond that kind of help now.\r\n", ch);
    return;
  }

In magic.c:
void mag_revive(int level, struct char_data * ch, struct char_data *
victim,
                int spellnum, int type)
{

    if (victim == NULL)
      return;

    switch (spellnum) {

    case SPELL_RAISE_DEAD:
          GET_POS(victim) = POS_STANDING;
          GET_HIT(victim) = 1;
          send_to_char("You have been raised from the dead!\r\n", victim);
          break;
    case SPELL_RESURRECT:
         GET_POS(victim) = POS_STANDING;
         GET_HIT(victim) = GET_MAX_HIT(victim);
         send_to_char("You have been resurrected and fully healed!\r\n",
victim);
         break;
    }

    update_pos(victim);
}

Now all this works fine.  The wierd thing is that after I implemented this
code and a player tries to animate a corpse the mud crashes.
The output from the core dump shows that the problem is in the code in
spell_parser.c:
#0  0x80b41bb in do_cast (ch=0x82e3dd0, argument=0xbffff904 " ", cmd=34,
 subcmd=0) at spell_parser.c:635
635        if (!IS_NPC(tch) && GET_POS(tch) == POS_DEAD &&
IS_SET(SINFO.routines, MAG_POINTS)) {

It doesn't make any sense to me as to why this is crashing the mud since
MAG_SUMMON doesn't seem to be used anywhere.

Any thoughts or ideas are very much appreciated.

Thanks,
Mark

--
   +---------------------------------------------------------------+
   | 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/05/01 PST