[IDEA] MOB_ISNPC hack

From: Andrey Fidrya (andrey@ALEX-UA.COM)
Date: 07/09/98


Hi, Jeremy!

I wrote a msg about removing MOB_ISNPC==PLR_DONTSET hack some time ago.
Now I tried to do it. I changed #define IS_NPC in utils.h to:
#define IS_NPC(ch)  ((ch)->pfilepos == -1)
and changed free_char() in db.c slightly:
1) Commented out this block:
/*
if (IS_NPC(ch))
  log("SYSERR: Mob %s (#%d) had player_specials allocated!", ......
*/
2) Changed these two lines:
if (!IS_NPC(ch) || (IS_NPC(ch) && GET_MOB_RNUM(ch) == -1)) {
  /* if this is a player, or a non-prototyped non-player, free all */
TO:
if (GET_MOB_RNUM(ch) == -1) {
  /* only players and non prototyped mobiles have ch->nr == -1, so free all */

Now everything works great!
Btw, circle.exe became 20 kb (!!!) smaller after recompiling.
What do you think about changing this in stock Circle?

  Andrey (andrey@alex-ua.com)
    aka Zmey//RMUD


     +------------------------------------------------------------+
     | 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/15/00 PST