Re: [CODE] die(char_data*, char_data*)

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 09/01/97


On Sun, 31 Aug 1997, George wrote:

-+On Sun, 31 Aug 1997, David Eliott wrote:
-+
-+>My die function now has two parameters, the victim, and the killer, but
-+>if there is no killer, how do I put a null statement or something of the
-+>sort in the killer parameter? For example, if ch dies from starvation,
-+>there is no killer, so what do I put in there?
-+
-+die(ch, NULL);

And, then, of course, have die() check 'if (killer)' before it tried to
use it. :)

  if (killer) {
    InfoMessage(INFO_DEATH, "%s has died at the hands of %s.", GET_NAME(vict),
                GET_NAME(killer));
    GET_DEATHS(vict, (bool)IS_NPC(kiler))++;
    GET_KILLS(killer,(bool)IS_NPC(vict))++;
  }

Anyway, that's just some demo code that would, ideally, send an INFO
message to the entire game; then increase the death and kill counters
for the victim and killer (respectively).  In other words, it's non-stock
stuff I just created off the top of my head; but it seems that stuff like
this is generally what the "killer" is added to die() for...


--
Daniel Koepke -:- dkoepke@california.com -:-  [Shadowlord/Nether]
Think.


     +------------------------------------------------------------+
     | 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