From 6f5efa3c7aa32c463fe0dae78a86a78f80cf1d1b Mon Sep 17 00:00:00 2001 From: XTZGZoReX Date: Tue, 31 Mar 2009 09:18:03 +0200 Subject: * Do not print chat logs to console. It will simply screw up console output. * Fix a possible crash in if/else checks in channel chat logging. --HG-- branch : trunk --- src/game/ChatHandler.cpp | 11 ++++++++--- src/shared/Log.cpp | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index 7c7a55b0ff1..0820c500ab6 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -503,12 +503,17 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data ) chn->HasFlag(CHANNEL_FLAG_GENERAL) || chn->HasFlag(CHANNEL_FLAG_CITY) || chn->HasFlag(CHANNEL_FLAG_LFG)) + { if(sWorld.getConfig(CONFIG_CHATLOG_SYSCHAN)) sLog.outChat("[SYSCHAN] Player %s tells channel %s: %s", - GetPlayer()->GetName(), chn->GetName().c_str(), msg.c_str()); - else if(sWorld.getConfig(CONFIG_CHATLOG_CHANNEL)) + GetPlayer()->GetName(), chn->GetName().c_str(), msg.c_str()); + } + else + { + if(sWorld.getConfig(CONFIG_CHATLOG_CHANNEL)) sLog.outChat("[CHANNEL] Player %s tells channel %s: %s", - GetPlayer()->GetName(), chn->GetName().c_str(), msg.c_str()); + GetPlayer()->GetName(), chn->GetName().c_str(), msg.c_str()); + } } } } break; diff --git a/src/shared/Log.cpp b/src/shared/Log.cpp index a52ca767a03..3d7d654a62a 100644 --- a/src/shared/Log.cpp +++ b/src/shared/Log.cpp @@ -837,7 +837,7 @@ void Log::outChat( const char * str, ... ) outTimestamp(chatLogfile); va_list ap; va_start(ap, str); - vfprintf(chatLogfile, str, ap); + fprintf(chatLogfile, str, ap); fprintf(chatLogfile, "\n" ); fflush(chatLogfile); va_end(ap); -- cgit v1.2.3