Re: [errors]

From: Daniel Koepke (dkoepke@california.com)
Date: 02/17/97


On Mon, 17 Feb 1997, Alex wrote:

> > ok i cant put a ) there
> Sure you can, you get to move it around a bit... watch:
> 
> Your code:
> > > >   if (GET_QUEST_MOB(ch) > 0) && (GET_MOB_VNUM(questmob) ==
> > > > GET_QUEST_MOB(ch)
> > > >     GET_QUEST_MOB(ch) < 0); 
> New code:
> 
>   if (GET_QUEST_MOB(ch) > 0) && (GET_MOB_VNUM(questmob) ==
>                       GET_QUEST_MOB(ch))
> /* the previous is the 'if' statement, the next is the result */
>     GET_QUEST_MOB(ch) < 0;
> 
> I have no idea what this is supposed to do, but hey, that's not
> what you asked (=

It makes no sense. If we count up the paranetheses:

  if ( GET_QUEST_MOB( ch ) > 0 ) &&
    ^^^                       ^^^

That second ends the if statement, but there's apparently supposed
to be more after that. So, remove the paranethese after the "> 0"
there. Then we have the "GET_QUEST_MOB < 0". Which is a boolean
check, but in this context it doesn't make sense either with logical
OR or a logical AND.

 if (GET_QUEST_MOB(ch) > 0 && (GET_MOB_VNUM(questmob) ==
     GET_QUEST_MOB(ch))

Has to be what the code is, the "GET_QUEST_MOB < 0" could not
logically be in the if statement (eg., if we substitute
GET_QUEST_MOB(ch) with 4 and GET_MOB_VNUM(questmob) with 5, and
kept the GET_QUEST_MOB(ch) < 0 in there, you'd get:

  if (4 > 0 && (4 == 5 || 4 < 0))
       true     false     false

  if (4 > 0 && (4 == 5 && 4 < 0))
       true     false     false

Even if GET_QUEST_MOB(ch) equals 5, it'd never be true). Thus,
I think the code is as I have shown above, compeltely eliminating
the GET_QUEST_MOB(ch) < 0 code.


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST