/*
* True if char can see victim.
*/
bool can_see( CHAR_DATA * ch, CHAR_DATA * victim )
{
if( !victim ) /* Gorog - panicked attempt to stop crashes */
return FALSE;
if( !ch )
{
if( ch->Class != CLASS_RANGER && IS_AFFECTED( victim, AFF_CAMO) )
return FALSE;
else if( IS_AFFECTED( victim, AFF_INVISIBLE ) || IS_AFFECTED( victim, AFF_HIDE ) || IS_AFFECTED( victim, AFF_CAMO || xIS_SET( victim->act, PLR_WIZINVIS ) ) )
return FALSE;
else
return TRUE;
}
if( ch == victim )
return TRUE;
if( !IS_NPC( victim ) && xIS_SET( victim->act, PLR_WIZINVIS ) && get_trust( ch ) < victim->pcdata->wizinvis )
return FALSE;
/*
* SB
*/
if( IS_NPC( victim ) && xIS_SET( victim->act, ACT_MOBINVIS ) && get_trust( ch ) < victim->mobinvis )
return FALSE;
/*
* Deadlies link-dead over 2 ticks aren't seen by mortals -- Blodkai
*/
if( !IS_IMMORTAL( ch ) && !IS_NPC( ch ) && !IS_NPC( victim ) && IS_PKILL( victim ) && victim->timer > 1 && !victim->desc )
return FALSE;
if( !IS_NPC( ch ) && xIS_SET( ch->act, PLR_HOLYLIGHT ) )
return TRUE;
/*
* The miracle cure for blindness? -- Altrag
*/
if( !IS_AFFECTED( ch, AFF_TRUESIGHT ) )
{
if( IS_AFFECTED( ch, AFF_BLIND ) )
return FALSE;
if( room_is_dark( ch->in_room ) && !IS_AFFECTED( ch, AFF_INFRARED ) )
return FALSE;
if( IS_AFFECTED( victim, AFF_INVISIBLE ) && !IS_AFFECTED( ch, AFF_DETECT_INVIS ) )
return FALSE;
if( IS_AFFECTED( victim, AFF_HIDE )
&& !IS_AFFECTED( ch, AFF_DETECT_HIDDEN )
&& !victim->fighting && ( IS_NPC( ch ) ? !IS_NPC( victim ) : IS_NPC( victim ) ) )
return FALSE;
}
/*
* Redone by Narn to let newbie council members see pre-auths.
*/
if( NOT_AUTHED( victim ) )
{
if( NOT_AUTHED( ch ) || IS_IMMORTAL( ch ) || IS_NPC( ch ) )
return TRUE;
if( ch->pcdata->council && !str_cmp( ch->pcdata->council->name, "Newbie Council" ) )
return TRUE;
return FALSE;
}
/* Commented out for who list purposes
if (!NOT_AUTHED(victim) && NOT_AUTHED(ch) && !IS_IMMORTAL(victim)
&& !IS_NPC(victim))
return FALSE;*/
return TRUE;
}
That is the code as-is after changes. Right now I cann't test it since I'm lacking a client to connect with, If you see any problems or whatever, please let me know, and let me know if you know of a good client for Linux :) |