[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  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] Refresh page


Posted by Kondi   (2 posts)  [Biography] 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!
[Go to top] top

Posted by Nick Gammon   Australia  (22,928 posts)  [Biography] 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
[Go to top] top

Posted by Kondi   (2 posts)  [Biography] 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         */
...
[Go to top] 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.


6,226 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]