[7408] Fixed last hidden non-localized message case in BattleGround.cpp.

Note:
1) CHAT_MSG_BG_SYSTEM_NEUTRAL not dependent from target guid so use SendMessageToAll
   and cleanup code
2) BattleGround.cpp now not dependent from Chat.h
This commit is contained in:
VladimirMangos 2009-03-08 08:51:02 +03:00
parent 28a8e0c9cf
commit cdf99bc169
2 changed files with 6 additions and 19 deletions

View file

@ -23,7 +23,6 @@
#include "Creature.h" #include "Creature.h"
#include "MapManager.h" #include "MapManager.h"
#include "Language.h" #include "Language.h"
#include "Chat.h"
#include "SpellAuras.h" #include "SpellAuras.h"
#include "ArenaTeam.h" #include "ArenaTeam.h"
#include "World.h" #include "World.h"
@ -577,15 +576,11 @@ void BattleGround::EndBattleGround(uint32 winner)
uint32 loser_rating = 0; uint32 loser_rating = 0;
uint32 winner_rating = 0; uint32 winner_rating = 0;
WorldPacket data; WorldPacket data;
Player *Source = NULL; int32 winmsg_id = 0;
const char *winmsg = "";
if(winner == ALLIANCE) if(winner == ALLIANCE)
{ {
if(isBattleGround()) winmsg_id = isBattleGround() ? LANG_BG_A_WINS : LANG_ARENA_GOLD_WINS;
winmsg = GetMangosString(LANG_BG_A_WINS);
else
winmsg = GetMangosString(LANG_ARENA_GOLD_WINS);
PlaySoundToAll(SOUND_ALLIANCE_WINS); // alliance wins sound PlaySoundToAll(SOUND_ALLIANCE_WINS); // alliance wins sound
@ -593,10 +588,7 @@ void BattleGround::EndBattleGround(uint32 winner)
} }
else if(winner == HORDE) else if(winner == HORDE)
{ {
if(isBattleGround()) winmsg_id = isBattleGround() ? LANG_BG_H_WINS : LANG_ARENA_GREEN_WINS;
winmsg = GetMangosString(LANG_BG_H_WINS);
else
winmsg = GetMangosString(LANG_ARENA_GREEN_WINS);
PlaySoundToAll(SOUND_HORDE_WINS); // horde wins sound PlaySoundToAll(SOUND_HORDE_WINS); // horde wins sound
@ -681,8 +673,6 @@ void BattleGround::EndBattleGround(uint32 winner)
if(team == winner) if(team == winner)
{ {
if(!Source)
Source = plr;
RewardMark(plr,ITEM_WINNER_COUNT); RewardMark(plr,ITEM_WINNER_COUNT);
UpdatePlayerScore(plr, SCORE_BONUS_HONOR, 20); UpdatePlayerScore(plr, SCORE_BONUS_HONOR, 20);
RewardQuest(plr); RewardQuest(plr);
@ -722,11 +712,8 @@ void BattleGround::EndBattleGround(uint32 winner)
// inform invited players about the removal // inform invited players about the removal
sBattleGroundMgr.m_BattleGroundQueues[BattleGroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType())].BGEndedRemoveInvites(this); sBattleGroundMgr.m_BattleGroundQueues[BattleGroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType())].BGEndedRemoveInvites(this);
if(Source) if(winmsg_id)
{ SendMessageToAll(winmsg_id,CHAT_MSG_BG_SYSTEM_NEUTRAL);
ChatHandler(Source).FillMessageData(&data, CHAT_MSG_BG_SYSTEM_NEUTRAL, LANG_UNIVERSAL, Source->GetGUID(), winmsg);
SendPacketToAll(&data);
}
} }
uint32 BattleGround::GetBattlemasterEntry() const uint32 BattleGround::GetBattlemasterEntry() const

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7407" #define REVISION_NR "7408"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__