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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Can anyone else see the error in this code?

Can anyone else see the error in this code?

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


Posted by Luna   (6 posts)  Bio
Date Fri 20 Feb 2004 02:23 AM (UTC)
Message
I've been trying to install the quest program snippet from http://www.mudshell.com/homesite/smaug_snippets/smaug_quest_snippet.htm
and though I've followed all of the instructions to the letter, fight.c does not compile with his snippet in there (removing it allowed it to compile with no errors.) Here is the section that is giving it trouble:

if (IS_SET(ch->act, PLR_QUESTOR)&&IS_NPC(victim))
{
if (ch->questmob == victim->pIndexData->vnum)
{
send_to_char("You have almost completed your QUEST!\n\r",ch);
send_to_char("Return to the questmaster before your time runs out!\n\r",ch);
ch->questmob = -1;
}
}

The error it was giving me was about an invalid operand to binary &

I'm not the greatest coder in the world; I assumed this meant there was some problem with the && in the code, so I tried this:

if (IS_SET(ch->act, PLR_QUESTOR)) {
if(IS_NPC(victim)) {
if (ch->questmob == victim->pIndexData->vnum){
send_to_char("You have almost completed your QUEST!\n\r",ch);
send_to_char("Return to the questmaster before your time runs out!\n\r",ch);
ch->questmob = -1;
}
}
}

but I got the same error.

Does anyone else see what the problem is? Help would be most appreciated. Thanks!
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #1 on Fri 20 Feb 2004 02:33 AM (UTC)
Message
I beleive that the problem may be that you do not have that particular flag set up. Double check that part of the snippet instructions.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Fri 20 Feb 2004 03:12 AM (UTC)
Message
It has nothing to do with the &&.

if (IS_SET(ch->act, PLR_QUESTOR)&&IS_NPC(victim))

Change that to

if (xIS_SET(ch->act, PLR_QUESTOR) && IS_NPC(victim))

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Luna   (6 posts)  Bio
Date Reply #3 on Fri 20 Feb 2004 06:17 AM (UTC)
Message
That worked like a charm! Thanks so much for your help!
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.


14,250 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.