[CODE] Crashes during affect_update in comm.c

From: Torgny Bjers (tb@sbbs.se)
Date: 08/07/00


  Server: CircleMUD 3.0, bpl 17
Add-ons: OasisOLC 2.0, Races, Classes, liblist,
         aedit 16, hedit, zone builder list, DG Scripts pl 7
      OS: Windows NT 4.0 Server
Hardware: Dell Precision 210 Workstation, Dual Processor
Compiler: Microsoft Developer Studio 97, C++ 5.0

Hello there,
    I cannot for the love of my life understand what it is I have done wrong
now. :(  Last weekend I added some spells, they all had affects.  One was a
light-version of Sanctuary, and another one was an entangler that heightened
the victim's AC.
    Now, I added these spells to the UNUSED bits in the AFF_X defines, since
I presumed these could be used, not being marked (R) or anything...

Whenever I cast the spell, ORB as I called it, it works properly as far as I
have seen when playing with it, but when the spell wears off, the server
crashes in affect_update (which is stock code, of course) here is a snip of
the spell ORB from magic.c, under mag_affects:

-----snip--------------------------------------------------------
  case SPELL_ORB:
    if (IS_AFFECTED(ch, AFF_SANCTUARY)) {
      send_to_char("You cannot use orb and sanctuary at the same time.\r\n",
ch);
      return;
    }
    af[0].duration = 4;
    af[0].bitvector = AFF_ORB;

    accum_duration = TRUE;
    to_vict = "A pale white aura momentarily surrounds you.";
    to_room = "$n is surrounded by a pale white aura.";
    break;
--------------------------------------------------------snip-----

and also, the shroud spell:

-----snip--------------------------------------------------------
  case SPELL_SHROUD:
    if (MOB_FLAGGED(victim,MOB_NOSHROUD) || mag_savingthrow(victim,
savetype, 0)) {
      send_to_char("You fail.\r\n", ch);
      return;
    }
    af[0].location = APPLY_AC;
    af[0].modifier = level / 3;
    af[0].duration = 3;
    af[0].bitvector = AFF_SHROUD;
    accum_duration = TRUE;
    to_room = "$n has been shrouded!";
    to_vict = "You have been shrouded!";
    break;
--------------------------------------------------------snip-----

and also, the aff_x's from structs.h:

-----snip--------------------------------------------------------
#define AFF_SHROUD            (1 << 16)    /* Char is shrouded (plus to AC)
*/
#define AFF_ORB               (1 << 17)    /* Char is protected by orb
*/
--------------------------------------------------------snip-----

These two were unused slots that I changed into AFF_SHROUD and AFF_ORB.

Could it have something to do with DG Scritps?  Or have I done something
wrong somewhere in my code here that causes the crash?  It seems that it is
only ORB that crashes...

Please help me out if you've got the time...

Kindest Regards,
/Torgny


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT