you basically did the same thing I just told you to.
what was happening is that the IF statement was looking at the entire thing
like an equation.
sn = find_spell( ch, arg ) < 0
sn = 278 < 0
sn = FALSE (0)
by setting 'sn = find_spell(ch,arg)' earlier, or putting () around it inside
the IF statement, you've
changed the order of operations. So you then get what you were expecting.
- Valnir
(sorry for the duplicate message, Mervine. forgot to send it to ROM the
first time)
----- Original Message -----
From: "Mervine, Keith" <[EMAIL PROTECTED]>
To: "Valnir" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Monday, November 08, 2004 2:45 PM
Subject: RE: Finding an affect by name and stopping it.
I changed the following and now it works.....
From:
if ( sn = find_spell( ch,arg ) < 0 )
{
send_to_char( "You don't of know any powers by that name.\n\r", ch
);
return;
}
To:
sn = find_spell( ch,arg );
if ( sn <= 0 )
{
send_to_char( "You don't know any powers by that name.\n\r", ch );
return;
}
Don't know why it worked but it did.
Thanks for all the help!
Keith
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Valnir
Sent: Monday, November 08, 2004 2:39 PM
To: [email protected]
Subject: Re: Finding an affect by name and stopping it.
Just for giggles, try put () around the "sn = find_spell(ch,arg)" so it
reads "if ( ( sn = find_spell(ch,arg) ) < 0 )"
- Valnir