speaks = IS_SET( chan_data[channel].language[x], ch->speaks );
if( IS_SET( ch->speaks, chan_data[channel].language[x] ) )
speaks = true;
if( knows_language( ch, chan_data[channel].language, ch ) == 100 )
speaks = true;
if( knows_language( ch, chan_data[channel].language, ch ) != 0 )
speaks = true;
if( knows_language( ch, chan_data[channel].language, ch ) >= someothernumber )
speaks = true;
act_comm.cpp:546: error: invalid conversion from `int*' to `int'
act_comm.cpp:546: error: initializing argument 2 of `int knows_language(CharData*, int, CharData*)'
if( knows_language( ch, chan_data[channel].language[x], ch ) != 0 )
speaks = true;
void showChanHistory( CharData * ch, const char *verb, int channel )
{
char buf[MSL], buf2[MSL], buf3[MSL], buf4[MSL];
int x, speakswell;
if( channel < 0 )
{
bug( "%s: unknown bitvector value '%d' passed", __FUNCTION__, channel );
return;
}
x = chan_data[channel].channel;
if( x == CHANNEL_GUILD || x == CHANNEL_CLAN || x == CHANNEL_ORDER )
{
showClanHist( ch, verb, channel );
return;
}
else if( x == CHANNEL_RACETALK )
{
showRaceHist( ch, verb, channel );
return;
}
if( !chan_data[channel].argument[0] || chan_data[channel].argument[0][0] == '\0' )
{
sprintf( buf, "&RNobody's used the '%s' channel!\r\n", verb );
ch->print( buf );
return;
}
else
{
sprintf( buf, "&WChannel history for '%s' channel:\r\n", verb );
ch->print( buf );
ch->setColor( chan_data[channel].color );
for( x = 0; x < MAX_CHANHISTORY; x++ )
{
int speaking = -1, lang;
const char *sbuf = chan_data[channel].argument[x];
for( lang = 0; lang_array[lang] != LANG_UNKNOWN; lang++ )
if( chan_data[channel].language[x] & lang_array[lang] )
{
speaking = lang;
break;
}
if( !chan_data[channel].argument[x] || chan_data[channel].argument[x][0] == '\0' )
{
if( x == 0 )
bug( "%s: channel history initialized, but has no data!", __FUNCTION__ );
return;
}
if( !str_cmp( ch->getName( ), chan_data[channel].histname[x] ) )
mudstrlcpy( buf, ch->getName( ), MSL );
else if( !ch->isNPC( )
&& !IS_AFFECTED( ch, AFF_TRUESIGHT )
&& !xIS_SET( ch->m_Act, PLR_HOLYLIGHT )
&& ( ( IS_SET( chan_data[channel].visibility[x], VIS_HIDE )
&& !IS_AFFECTED( ch, AFF_DETECT_HIDDEN ) )
|| ( IS_SET( chan_data[channel].visibility[x], VIS_INVIS )
&& !IS_AFFECTED( ch, AFF_DETECT_INVIS ) ) ) )
mudstrlcpy( buf, "Someone", MSL );
else if( IS_SET( chan_data[channel].visibility[x], VIS_WIZINVIS )
&& ch->checkTrust( ) < chan_data[channel].invislevel[x] )
mudstrlcpy( buf, "Someone", MSL );
else
mudstrlcpy( buf, chan_data[channel].histname[x], MSL );
if( speaking != -1 && ( !ch->isNPC( ) || chan_data[channel].language[x] ) )
{
speakswell = knows_language( ch, chan_data[channel].language[x], ch );
if( speakswell < 85 )
sbuf = translate( speakswell, chan_data[channel].argument[x], lang_names[speaking] );
}
mudstrlcpy( buf2, chan_data[channel].argument[x], MSL );
ch->printf( "&W[&D%s&W] ", mini_c_time( chan_data[channel].timestamp[x],
ch->getPcData( )->timezone ) );
if( !chan_data[channel].emote[x] && ( chan_data[channel].channel == -1
|| chan_data[channel].channel == CHANNEL_NEWBIE
|| chan_data[channel].channel == CHANNEL_MUSIC ) )
{
sprintf( buf4, "%ss", verb );
ch->printf( chan_data[channel].buf_text, buf, buf4, sbuf );
}
else if( !chan_data[channel].emote[x] && chan_data[channel].channel != -1
&& chan_data[channel].channel != CHANNEL_IMMTALK )
ch->printf( chan_data[channel].buf_text, capitalize( verb ), buf, sbuf );
else if( !chan_data[channel].emote[x] && chan_data[channel].channel == CHANNEL_IMMTALK )
ch->printf( chan_data[channel].buf_text, capitalize( verb ), buf, buf2 );
else
{
sprintf( buf3, "%s %s\r\n", buf, buf2 );
ch->printf( chan_data[channel].prefix, capitalize( verb ), buf3 );
}
}
return;
}
}
Well, now you know what's in them. This is where it's showing it to them.
The problem appears when the code reaches line 64 above. Here's the problem.
[Chat] You: Test
<32700hp 30000m 30000mv>
Channel history for 'chat' channel:
[01/06/09 07:27P] [Chat] Kayle: Test
[Chat] Kayle: Test
<454hp 297m 292mv>
Channel history for 'chat' channel:
[01/06/09 12:27P] [Chat] Kayle: Grtq
Now, if I change lines 68-79 to:
It then looks like this:
[Chat] You: Test
<32700hp 30000m 30000mv>
Channel history for 'chat' channel:
[01/06/09 08:35P] [Chat] Kayle: Kgai
[01/06/09 08:35P] [Chat] Scoyn: test
[Chat] Kayle: Test
<454hp 297m 292mv>
Channel history for 'chat' channel:
[01/06/09 12:35P] [Chat] Kayle: Test
[01/06/09 12:35P] [Chat] Scoyn: ngtu
Here's the kicker. Immortals know all languages, and speak all languages. Nothing should be scrambling for either of us since we're both immortals. Now, I don't want to just rip out the language support because languages are going to play a large role in MW's gameplay. So I need to figure out where this is going wrong and try and fix it, and I'm running into dead end after dead end. And maybe it's because I've been staring at this for so long.
After previewing this I realized some people my be confused by some of the things in the code itself, and by the difference in timestamps between Scoyn and I. Well, Scoyn's a 'tard and never set his timezone properly so his times are off. Now the syntax in the code is a bit less funny. I converted char_data to a class and encapsulated things and moved things and made them member functions. So.. Yeah. Clears up all that. Now let's talk about the oddness of it all.