Bugs in PL 14

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


Hi, All!
Here's what I found:

Interpreter.c; line 612:
  else if (PLR_FLAGGED(ch, PLR_FROZEN) && GET_LEVEL(ch) < LVL_IMPL)
change to:
  else if (!IS_NPC(ch) && ... )

Comm.c; line 2154:
#define SENDOK(ch) ((ch)->desc && (AWAKE(ch) || sleep) && \
                    !PLR_FLAGGED((ch), PLR_WRITING))
change to:
#define SENDOK(ch) ((ch)->desc && (AWAKE(ch) || sleep) && \
            (IS_NPC(ch) || !PLR_FLAGGED((ch), PLR_WRITING)))
^^ and move it to utils.h

Fight.c; line 929:  more serious bug: if player with PLR_KILLER flag tries
                    to attack someone, he is treated as mobile:
    if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != NULL)
      (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
change to:
    if (IS_NPC(ch) && MOB_FLAGGED(ch, MOB_SPEC)) {
      if (ch->nr > -1 && mob_index[GET_MOB_RNUM(ch)].func != NULL)
        (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
      else
        log("SYSERR: Non-indexed NPC or MOB without function is flagged with
MOB_SPEC.");
    }

Act.informatice.c; line 294:
  if (PLR_FLAGGED(i, PLR_WRITING))
    strcat(buf, " (writing)");
change to:
  if (!IS_NPC(i) && PLR_FLAGGED(i, PLR_WRITING))
    strcat(buf, " (writing)");

To detect other bugs of this type:
// first of all, remove CHECK() from PRF_FLAGS:
#define PRF_FLAGS(ch) ((ch)->player_specials->saved.pref)
// now replace the following macros with these ones:
#define MOB_FLAGGED(ch, flag) (IS_NPC(ch) ? IS_SET(MOB_FLAGS(ch), (flag)) : \
                       log("SYSERR: PC using MOB_FLAGS at %s:%d.", __FILE__,
__LINE__), FALSE)
#define PLR_FLAGGED(ch, flag) (!IS_NPC(ch) ? IS_SET(PLR_FLAGS(ch), (flag)) : \
                       log("SYSERR: NPC using PLR_FLAGS at %s:%d.", __FILE__,
__LINE__), FALSE)
#define PRF_FLAGGED(ch, flag) (!IS_NPC(ch) ? IS_SET(PRF_FLAGS(ch), (flag)) :\
                         (ch)->desc && (ch)->desc->original ? \
                         IS_SET(PRF_FLAGS((ch)->desc->original), (flag)) : \
                         log("SYSERR: non-switched NPC using PRF_FLAGS at
%s:%d.", __FILE__, __LINE__) ,0)

Ok, now I want to suggest another idea.
We can change few macros and allow switched players to use their color
and full statusbar (mobile's). (see how I made PRF_FLAGGED work?)
To George: If you're interested in implementing this, I can send you
everything I
changed to made it work.

Also, I think that ripping out entire commands for mobiles (do_score)
because of few variables (condition) whose can be avoided with a simple
if(!IS_NPC) is a bad thing to do.

  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