[Code] !MOB flag

From: Roger Smith (sexycoder@HOTMAIL.COM)
Date: 10/08/98


   I have just about given up.  Somewhere along the line I must have
messed up something with flags because the !mob flag doesn't work in
rooms.
   Other room flags work, so perhaps it's a problem with mob flags.  But
the rest of the mob flags work and I haven't messed with mobact.c.
   Something that may contribute to this problem is 128-bit flags which
I added a long time ago.  I am stuck, please help.

in mobact.c:
    /* Mob Movement */
    if (!MOB_FLAGGED(ch, MOB_SENTINEL) && (GET_POS(ch) == POS_STANDING)
&&
        ((door = number(0, 18)) < NUM_OF_DIRS) && CAN_GO(ch, door) &&
        (!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_NOMOB) ||
         !ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_DEATH)) &&
        (!MOB_FLAGGED(ch, MOB_STAY_ZONE) ||
         (world[EXIT(ch, door)->to_room].zone ==
world[ch->in_room].zone))) {
      perform_move(ch, door, 1);
    }

in utils.h:
#define Q_FIELD(x)  ((int) (x) / 32)
#define Q_BIT(x)    (1 << ((x) % 32))

#define IS_SET_AR(var, bit)       ((var)[Q_FIELD(bit)] & Q_BIT(bit))

#define MOB_FLAGS(ch) ((ch)->char_specials.saved.act)
#define ROOM_FLAGS(loc) (world[(loc)].room_flags)

#define MOB_FLAGGED(ch, flag) (IS_NPC(ch) && IS_SET_AR(MOB_FLAGS(ch),
(flag)))
#define ROOM_FLAGGED(loc, flag) (IS_SET_AR(ROOM_FLAGS(loc), (flag)))

#define EXIT(ch, door)  (world[(ch)->in_room].dir_option[door])

#define CAN_GO(ch, door) (EXIT(ch,door) && \
                         (EXIT(ch,door)->to_room != NOWHERE) && \
                         !IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))

Anybody know what might be causing this?

-Roger

***It's not a bug, it's unwanted code!***

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


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