What's the difference: PLR_ and PCDATA_ flags

Posted by Kondi on Fri 30 Jul 2021 10:57 PM — 3 posts, 13,119 views.

#0
Hello!

I'm digging through SMAUG 2.0 and noticed that there are two sets of flags, which both appear to be only for players: ch->act and ch->pcdata->flags.

Can anyone explain the difference (if any), or the rationale behind splitting them? If I were to add a new flag, how do I decide which set it gets added to?

Thanks!
Australia Forum Administrator #1
I'm not sure but maybe this comment in the source helps:


/*
 * Data which only PC's have.
 */
struct pc_data
{
   CHAR_DATA *pet;
   CLAN_DATA *clan;
   COUNCIL_DATA *council;
...


So I guess the PCDATA flags are for players and the others are for mobs and players.
#2
The comment next to the PLR_ flags suggests that they're for players too!


/*
 * ACT bits for players.
 */
typedef enum
{
  PLR_IS_NPC, PLR_BOUGHT_PET, PLR_SHOVEDRAG, PLR_AUTOEXIT, PLR_AUTOLOOT,
  PLR_AUTOSAC, PLR_BLANK, PLR_OUTCAST, PLR_BRIEF, PLR_COMBINE, PLR_PROMPT,
  PLR_TELNET_GA, PLR_HOLYLIGHT, PLR_WIZINVIS, PLR_ROOMVNUM, PLR_SILENCE,
  PLR_NO_EMOTE, PLR_ATTACKER, PLR_NO_TELL, PLR_LOG, PLR_DENY, PLR_FREEZE,
  PLR_THIEF, PLR_KILLER, PLR_LITTERBUG, PLR_ANSI, PLR_RIP, PLR_NICE, PLR_FLEE,
  PLR_AUTOGOLD, PLR_AUTOMAP, PLR_AFK, PLR_INVISPROMPT, PLR_ROOMVIS,
  PLR_NOFOLLOW, PLR_LANDED, PLR_BLOCKING, PLR_IS_CLONE, PLR_IS_DREAMFORM,
  PLR_IS_SPIRITFORM, PLR_IS_PROJECTION, PLR_CLOAK, PLR_COMPASS,
  PLR_NOHOMEPAGE


These ones are stored on ch->act for players. Whereas it looks like there are also ACT_ flags for ch->act for mobiles.


/*
 * ACT bits for mobs.
 * Used in #MOBILES.
 */
#define ACT_IS_NPC		  		0	/* Auto set for mobs    */
#define ACT_SENTINEL		  	1	/* Stays in one room    */
#define ACT_SCAVENGER		  	2	/* Picks up objects     */
#define ACT_NOLOCATE		  	3	/* Nolocate for mob's objs */
#define ACT_AGGRESSIVE		  5	/* Attacks PC's         */
...