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

Gammon 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]  bool spec guard
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

bool spec guard

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


Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Thu 23 Sep 2004 07:28 PM (UTC)
Message
In this bool, what this does is sees if the character is outlawed, crimmed, or aggressive to the race. but if my character is disguised, i want him to bypass taht. i put this in the bool:


if (xIS_AFFECTED (ch, AFFX_DISGUISE))
                 {
                 act ("$n intently scans around the room.\n\r", ch, NULL, NULL, TO_ROOM);
                         return;
                 }


but it comes up as a warning. i figure i can't put a return in a bool statement? what would i put in then?

here's my warning;

return' with no value, in function returning non-void

so i'm not sure what else i can use.
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #1 on Thu 23 Sep 2004 09:44 PM (UTC)
Message
try this:

if (xIS_AFFECTED (ch, AFFX_DISGUISE))
{
   act ("$n intently scans around the room.\n\r", ch, NULL, NULL, TO_ROOM);
   return FALSE;
}

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #2 on Fri 24 Sep 2004 12:30 AM (UTC)
Message
Yes. The 'bool statement' is actually a function returning a boolean. It's telling you that you shouldn't just return out of the function; you have to return something.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[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.


4,013 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 FutureQuest]