> Ok, lets say that someone wants to distinguish between mobs and > not_mobs...I thought you would use the IS_NPC...but with this little > snippet of code.. > > if(!IS_NPC(ch)){ > send_to_char("Not a mob",ch); > }else{ > send_to_char("A mob.",ch); > } > > It always assumes it is a mob and never, ever hits not_mob. Any ideas? > Am I using the macro wrong?? I just looked at this macro in the current version of the code i've got..3.0bpl14. The macro reads: utils.h:#define IS_NPC(ch) (IS_SET(MOB_FLAGS(ch), MOB_ISNPC)) A bit more detective work shows us that mob_flags is.. utils.h:#define MOB_FLAGS(ch) ((ch)->char_specials.saved.act) however, there's another macro that accesses that same struct.. utils.h:#define PLR_FLAGS(ch) ((ch)->char_specials.saved.act) So, now we see that checking MOB_FLAGS to see if someone is a mob or not is pointless unless we already know they're a mob. *Sigh*. Oh, but wait you say, that can't be right.. and you'd be correct in saying so, since if we look up MOB_ISNPC, we see it is the bitvector (1 << 3).. the same as the 4'th entry in the PLR_ flags... the one that reads something like PLR_DONTSET. (Activate idea lightbulb over head) I'd have to gamble then, that you've redone some of the plr_flags, and overwrote that one, and it's now in common usage. Of course, you could also always try the 'IS_MOB' macro, which does check for IS_NPC, but also checks and sees if the nr is > -1. PjD +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST