Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ What's the difference: PLR_ and PCDATA_ flags

What's the difference: PLR_ and PCDATA_ flags

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Kondi   (2 posts)  Bio
Date Fri 30 Jul 2021 10:57 PM (UTC)
Message
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!
Top

Posted by Nick Gammon   Australia  (23,098 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 30 Jul 2021 11:50 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Kondi   (2 posts)  Bio
Date Reply #2 on Sat 31 Jul 2021 12:09 AM (UTC)
Message
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         */
...
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


8,288 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.