> I'm going to have to disagree here.  Take a look at the stock code.
>
>        if ( victim == NULL && obj == NULL)
>           if (ch->fighting != NULL)
>               victim = ch->fighting;
>           else
>           {
>               send_to_char("You can't do that.\n\r",ch);
>               return;
>           }
>

Correct, the indentation leads you to believe that it should be part of
the second if.  But if you move the else back, you have your null check.

IE
         if ( victim == NULL && obj == NULL )
         {
              if ( ch->fighting != NULL )
                  victim = ch->fighting;
         }
         else
         {
              send_to_char("You can't do that.\n\r",ch);
              return;
         }

Which fixes your error, and AFAIK is the correct way to correct way to fix
the "Suggest Parenthesis.." warning, and fixes the NULL error crash.

Jef



Reply via email to