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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Anti-flags not working properly...

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Anti-flags not working properly...
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Fri 08 Apr 2005 11:31 AM (UTC)  quote  ]
Message
Quote:

I also noticed that most "sh_int's" were replaced with "short". Is their a reason for this?


Because sh_int was a needless typedef for the proper type "short". Honestly didn't see any reason to continue using it even though other Merc bases have just left it in place since it was first added. I did an extensive Google search for it and it never shows up in anything outside of MUD code.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Fri 08 Apr 2005 01:10 AM (UTC)  quote  ]
Message
Class was changed because you cannot use "class" in C++ and I assume Samson did that to make it easier in the conversion to C++ if one is done. I did a quick look over your posted code and saw nothing wrong.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Anavel   Mexico  (124 posts)  [Biography] bio
Date Thu 07 Apr 2005 11:08 PM (UTC)  quote  ]

Amended on Fri 08 Apr 2005 12:37 AM (UTC) by Anavel

Message

Build.c:

char *	const	o_flags	[] =
{
"glow", "hum", "dark", "loyal", "evil", "invis", "magic", "nodrop", "bless",
"antigood", "antievil", "antineutral", "noremove", "inventory",
"antihuman", "antifighter", "antifircedemon", "antifiredemon", "organic", "metal",
"donation", "clanobject", "clancorpse", "antifoxdemon", "antispiritdet", 
"hidden", "poisoned", "covering", "deathrot", "buried", "prototype", 
"nolocate", "groundrot", "lootable", "antispirithm", "antiwarrior"
};

mud.h:

typedef enum
{
  ITEM_GLOW, ITEM_HUM, ITEM_DARK, ITEM_LOYAL, ITEM_EVIL, ITEM_INVIS, ITEM_MAGIC, 
  ITEM_NODROP, ITEM_BLESS, ITEM_ANTI_GOOD, ITEM_ANTI_EVIL, ITEM_ANTI_NEUTRAL, 
  ITEM_NOREMOVE, ITEM_INVENTORY, ITEM_ANTI_HUMAN, ITEM_ANTI_FIGHTER, 
  ITEM_ANTI_FIRCE_DEMON, ITEM_ANTI_FIRE_DEMON, ITEM_ORGANIC, ITEM_METAL, ITEM_DONATION, 
  ITEM_CLANOBJECT, ITEM_CLANCORPSE, ITEM_ANTI_FOX_DEMON, ITEM_ANTI_SPIRIT_DET, 
  ITEM_HIDDEN, ITEM_POISONED, ITEM_COVERING, ITEM_DEATHROT, ITEM_BURIED, 
  ITEM_PROTOTYPE, ITEM_NOLOCATE, ITEM_GROUNDROT, ITEM_LOOTABLE, ITEM_ANTI_SPIRIT_HM,
  ITEM_ANTI_WARRIOR,
  MAX_ITEM_FLAG
} item_extra_flags;

act_obj.c:
    if ( !IS_IMMORTAL(ch)
    &&  (( IS_OBJ_STAT(obj, ITEM_ANTI_HUMAN)
        && ch->class == CLASS_HUMAN					)
    ||   ( IS_OBJ_STAT(obj, ITEM_ANTI_FIGHTER)
        && ch->class == CLASS_FIGHTER					)
    ||   ( IS_OBJ_STAT(obj, ITEM_ANTI_FIRCE_DEMON)
	&& ch->class == CLASS_FIRCE_DEMON					)
    ||   ( IS_OBJ_STAT(obj, ITEM_ANTI_FIRE_DEMON)
	&& ch->class == CLASS_FIRE_DEMON					)
    ||   ( IS_OBJ_STAT(obj, ITEM_ANTI_FOX_DEMON)
	&& ch->class == CLASS_FOX_DEMON					)
    ||   ( IS_OBJ_STAT(obj, ITEM_ANTI_SPIRIT_DET)
	&& ch->class == CLASS_SPIRIT_DET					)
    ||   ( IS_OBJ_STAT(obj, ITEM_ANTI_SPIRIT_HM)
	&& ch->class == CLASS_SPIRIT_HM					)
    ||	 ( IS_OBJ_STAT(obj, ITEM_ANTI_WARRIOR)
	&& ch->class == CLASS_WARRIOR					)) )
    {
	act( AT_MAGIC, "You are forbidden to use that item.", ch, NULL, NULL, TO_CHAR );
	act( AT_ACTION, "$n tries to use $p, but is forbidden to do so.",
	    ch, obj, NULL, TO_ROOM );
	return;
    }

handler.c:

    if ( xIS_SET(*extra_flags, ITEM_ANTI_HUMAN)	) strcat( buf, " anti-human"    );
    if ( xIS_SET(*extra_flags, ITEM_ANTI_FIGHTER) ) strcat( buf, " anti-fighter"   );
    if ( xIS_SET(*extra_flags, ITEM_ANTI_FIRCE_DEMON) ) strcat( buf, " anti-firce-demon" );
    if ( xIS_SET(*extra_flags, ITEM_ANTI_FIRE_DEMON) ) strcat( buf, " anti-fire-demon"  );
    if ( xIS_SET(*extra_flags, ITEM_ANTI_FOX_DEMON)	) strcat( buf, " anti-fox-demon"   );
    if ( xIS_SET(*extra_flags, ITEM_ANTI_SPIRIT_DET)) strcat( buf, " anti-spirit-det" );
    if ( xIS_SET(*extra_flags, ITEM_ANTI_SPIRIT_HM) ) strcat( buf, " anti-spirit-hm"  );
    if ( xIS_SET(*extra_flags, ITEM_ANTI_WARRIOR) ) strcat( buf, " anti-warrior"   );



Heres the object:

Name: Some battle armor
Vnum: 10320 Type: armor Count: 3 Gcount: 1
Serial#: 67 TopIdxSerial#: 67 TopSerial#: 67
Short description: Some battle armor
Long description : Some battle armor is here.
Wear flags : take body
Extra flags: glow antiwarrior
Magic flags: none
Number: 1/1 Weight: 1/1 Layers: 0 Wear_loc: -1
Cost: 0 Rent: 0 Timer: 0 Level: 0
In room: 0 In object: (none) Carried by: Anavel
Index Values : 0 0 0 0 5600 5600.
Object Values: 0 0 0 0 5600 5600.


Mortal:
class : 00/Warrior

Problem is that my mortal can still wear the object with the anti flag.

Obed gets Some battle armor.
Obed fits Some battle armor on his body.

Did I miss something?

[EDIT] I downloaded the recent SmaugFUSS and examed the code with mine and I realized something in the newer FUSS, it had "class" capitalized: ch->Class. Anyways I changed it to how it was in the newer FUSS and the anti flags seem to be working now. Seems that their was a fix for this, but I never saw it on any of Samson's message boards.

[EDIT 2] I also noticed that most "sh_int's" were replaced with "short". Is their a reason for this?
[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.


1,715 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]