Checkthis out im in do_openbay and im setting up so clan members can remotely open the bay doors.
if ( str_cmp(ch->name,target->owner) && str_cmp(ch->name,target->pilot) && str_cmp(ch->name,target->copilot) /*&& str_cmp(ch->pcdata->clan->name,target->owner)*/ )
{
send_to_char("&RAuthorization denied.\n\r",ch);
return;
}
if ( str_cmp(ch->name,target->owner) && str_cmp(ch->name,target->pilot) && str_cmp(ch->name,target->copilot) && str_cmp(ch->pcdata->clan->name,target->owner) )
{
send_to_char("&RAuthorization denied.\n\r",ch);
return;
}
the first one works fine when the condition is true and when the condition is false (condition being if they are a pilot and whatnot) the second one works properly if the condiction is true and they DO have authorization, however it crashes the mud if its false. I know i must be comparing the two strings incorrectly, but could one of you guys tell me why its not working the way it is?
if ( str_cmp(ch->name,target->owner) && str_cmp(ch->name,target->pilot) && str_cmp(ch->name,target->copilot) /*&& str_cmp(ch->pcdata->clan->name,target->owner)*/ )
{
send_to_char("&RAuthorization denied.\n\r",ch);
return;
}
if ( str_cmp(ch->name,target->owner) && str_cmp(ch->name,target->pilot) && str_cmp(ch->name,target->copilot) && str_cmp(ch->pcdata->clan->name,target->owner) )
{
send_to_char("&RAuthorization denied.\n\r",ch);
return;
}
the first one works fine when the condition is true and when the condition is false (condition being if they are a pilot and whatnot) the second one works properly if the condiction is true and they DO have authorization, however it crashes the mud if its false. I know i must be comparing the two strings incorrectly, but could one of you guys tell me why its not working the way it is?