Re: [MULTI PATCH] Crashes with George's Patch 743@sps43.candu.aecl.ca>

From: Akuma/Chris Baggett/DOOMer (doomer@BAYOU.COM)
Date: 10/09/97


At 09:33 AM 10/9/97 -0400, you wrote:
>I am also having this problem though I didn't notice until this mail
>came through(mud isn't open yet)...
>
>the offending lines seem to be...
>
>if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOLOOT))
>  do_get(ch,"all corpse",0,0);
>
>I don't see any prob with it though...its' right after the die( victim )
>call...
>
  I do believe that's your problem.
you probably shouldn't have a check for IS_NPC(victim) after you've
already killed the victim.

you may need something like
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOLOOT))
  {
  if (IS_NPC(victim))
     { die(victim); do_get(ch, "all corpse", 0, 0); }
  }
else die(victim);

this will still keep PC's from autolooting PC's,
and save you the trouble of checking the IS_NPC bit on a dead
mob.

what this does, is checks FIRST if the character is an PC,
and has AUTOLOOT. If so, and the victim is an NPC,
THEN we kill the victim, and get all corpse,
else its a PC, and don't want AUTOLOOT on PC vs PC, so we
just die(victim);

the other altervative is to allow PC's to AUTOLOOT other PC's,
and that's just a simple removal of the IS_NPC(victim) check.
that will solve your problem too.

if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOLOOT))
  do_get(ch,"all corpse",0,0);

just remember, in functions that kill of a mob, or extract objs,
make sure that there is STILL an object.

there may be other ways of doing this, (I know this from Computer Science I)
and if you find them, good for you :-)

Code On
Akuma the Raging Coder

  +------------------------------------------------------------+
  | "The poets talk about love, but what I talk about is DOOM, |
  |      because in the end, DOOM is all that counts." -       |
  |   Alex Machine/George Stark/Stephen King, The Dark Half    |
  |        "Nothing is IMPOSSIBLE, Just IMPROBABLE"            |
  |   "Easier Said Than Done, But Better Done Than Said..."    |
  +------------------------------------------------------------+


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



This archive was generated by hypermail 2b30 : 12/08/00 PST