This is a rather simple-sounding problem, but I cann't figure how to fix it.
void do_whisper( CHAR_DATA * ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_INPUT_LENGTH];
CHAR_DATA *victim;
int position;
int speaking = -1, lang;
#ifndef SCRAMBLE
for( lang = 0; lang_array[lang] != LANG_UNKNOWN; lang++ )
if( ch->speaking & lang_array[lang] )
{
speaking = lang;
break;
}
#endif
REMOVE_BIT( ch->deaf, CHANNEL_WHISPER );
argument = one_argument( argument, arg );
if( arg[0] == '\0' || argument[0] == '\0' )
{
send_to_char( "Whisper to whom what?\n\r", ch );
return;
}
if( ( victim = get_char_room( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if( ch == victim )
{
send_to_char( "You have a nice little chat with yourself.\n\r", ch );
return;
}
if( !IS_NPC( victim ) && ( victim->switched ) && !IS_AFFECTED( victim->switched, AFF_POSSESS ) )
{
send_to_char( "That player is switched.\n\r", ch );
return;
}
else if( !IS_NPC( victim ) && ( !victim->desc ) )
{
send_to_char( "That player is link-dead.\n\r", ch );
return;
}
if( !IS_NPC( victim ) && xIS_SET( victim->act, PLR_AFK ) )
{
send_to_char( "That player is afk.\n\r", ch );
return;
}
if( IS_SET( victim->deaf, CHANNEL_WHISPER ) && ( !IS_IMMORTAL( ch ) || ( get_trust( ch ) < get_trust( victim ) ) ) )
{
act( AT_PLAIN, "$E has $S whispers turned off.", ch, NULL, victim, TO_CHAR );
return;
}
if( !IS_NPC( victim ) && xIS_SET( victim->act, PLR_SILENCE ) )
send_to_char( "That player is silenced. They will receive your message but can not respond.\n\r", ch );
if( victim->desc /* make sure desc exists first -Thoric */
&& victim->desc->connected == CON_EDITING && get_trust( ch ) < LEVEL_GOD )
{
act( AT_PLAIN, "$E is currently in a writing buffer. Please try again in a few minutes.", ch, 0, victim, TO_CHAR );
return;
}
/*
* Check to see if target of tell is ignoring the sender
*/
if( is_ignoring( victim, ch ) )
{
/*
* If the sender is an imm then they cannot be ignored
*/
if( !IS_IMMORTAL( ch ) || get_trust( victim ) > get_trust( ch ) )
{
set_char_color( AT_IGNORE, ch );
ch_printf( ch, "%s is ignoring you.\n\r", victim->name );
return;
}
else
{
set_char_color( AT_IGNORE, victim );
ch_printf( victim, "You attempt to ignore %s, but " "are unable to do so.\n\r", ch->name );
}
}
act( AT_WHISPER, "You whisper to $N '$t'", ch, argument, victim, TO_CHAR );
position = victim->position;
victim->position = POS_STANDING;
#ifndef SCRAMBLE
if( speaking != -1 && ( !IS_NPC( ch ) || ch->speaking ) )
{
int speakswell = UMIN( knows_language( victim, ch->speaking, ch ),
knows_language( ch, ch->speaking, victim ) );
if( speakswell < 85 )
act( AT_WHISPER, "$n whispers to you '$t'", ch, translate( speakswell, argument, lang_names[speaking] ), victim, TO_VICT );
}
else
act( AT_WHISPER, "$n whispers to you '$t'", ch, argument, victim, TO_VICT );
#else
if( !knows_language( vch, ch->speaking, ch ) && ( !IS_NPC( ch ) || ch->speaking != 0 ) )
act( AT_WHISPER, "$n whispers to you '$t'", ch, translate( speakswell, argument, lang_names[speaking] ), victim, TO_VICT );
else
act( AT_WHISPER, "$n whispers to you '$t'", ch, argument, victim, TO_VICT );
#endif
if( !IS_SET( ch->in_room->room_flags, ROOM_SILENCE ) )
act( AT_WHISPER, "$n whispers something to $N.", ch, argument, victim, TO_NOTVICT );
victim->position = position;
if( IS_SET( ch->in_room->room_flags, ROOM_LOGSPEECH ) )
{
sprintf( buf, "%s: %s (whisper to) %s.",
IS_NPC( ch ) ? ch->short_descr : ch->name, argument, IS_NPC( victim ) ? victim->short_descr : victim->name );
append_to_file( LOG_FILE, buf );
}
mprog_speech_trigger( argument, ch );
return;
}
Something in there is broke. You can send a whisper, but the target never gets it. I dunno what is wrong... |