Can anyone else see the error in this code?

Posted by Luna on Fri 20 Feb 2004 02:23 AM — 4 posts, 15,360 views.

#0
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!
Canada #1
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.
USA #2
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))
#3
That worked like a charm! Thanks so much for your help!