[7388] Fixed battleground premature warning message. SQL files are attached, you must execute them! Author: Triply
Fix for message's color will be soon. --HG-- branch : trunk
This commit is contained in:
1 parent
6f595b3038
commit
13fc3dcd7e
6 files changed
+39
-9
No files matched your search
@@ -230,7 +230,6 @@ void BattleGround::Update(uint32 diff)
|
||||
{
|
||||
m_PrematureCountDown = true;
|
||||
m_PrematureCountDownTimer = sBattleGroundMgr.GetPrematureFinishTime();
|
||||
SendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING);
|
||||
}
|
||||
else if(m_PrematureCountDownTimer < diff)
|
||||
{
|
||||
@@ -242,8 +241,17 @@ void BattleGround::Update(uint32 diff)
|
||||
{
|
||||
uint32 newtime = m_PrematureCountDownTimer - diff;
|
||||
// announce every minute
|
||||
if(m_PrematureCountDownTimer != sBattleGroundMgr.GetPrematureFinishTime() && newtime / 60000 != m_PrematureCountDownTimer / 60000)
|
||||
SendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING);
|
||||
if( newtime > (MINUTE * IN_MILISECONDS) )
|
||||
{
|
||||
if( newtime / (MINUTE * IN_MILISECONDS) != m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS) )
|
||||
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING, (uint32)(m_PrematureCountDownTimer / (MINUTE * IN_MILISECONDS)));
|
||||
}
|
||||
else
|
||||
{
|
||||
//announce every 15 seconds
|
||||
if( newtime / (15 * IN_MILISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILISECONDS) )
|
||||
PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, (uint32)(m_PrematureCountDownTimer / IN_MILISECONDS));
|
||||
}
|
||||
m_PrematureCountDownTimer = newtime;
|
||||
}
|
||||
}
|
||||
@@ -1047,7 +1055,7 @@ void BattleGround::RemoveFromBGFreeSlotQueue()
|
||||
// returns the number how many players can join battleground to MaxPlayersPerTeam
|
||||
uint32 BattleGround::GetFreeSlotsForTeam(uint32 Team) const
|
||||
{
|
||||
//if BG is starting ... invite anyone
|
||||
//return free slot count to MaxPlayerPerTeam
|
||||
if (GetStatus() == STATUS_WAIT_JOIN || GetStatus() == STATUS_IN_PROGRESS)
|
||||
return (GetInvitedCount(Team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(Team) : 0;
|
||||
|
||||
@@ -1414,6 +1422,18 @@ void BattleGround::SendMessageToAll(int32 entry)
|
||||
SendPacketToAll(&data);
|
||||
}
|
||||
|
||||
//copied from void ChatHandler::PSendSysMessage(int32 entry, ...)
|
||||
void BattleGround::PSendMessageToAll(int32 entry, ...)
|
||||
{
|
||||
const char *format = GetMangosString(entry);
|
||||
va_list ap;
|
||||
char str [2048];
|
||||
va_start(ap, entry);
|
||||
vsnprintf(str,2048,format, ap );
|
||||
va_end(ap);
|
||||
SendMessageToAll(str);
|
||||
}
|
||||
|
||||
void BattleGround::EndNow()
|
||||
{
|
||||
RemoveFromBGFreeSlotQueue();
|
||||
|
||||
Reference in new issue
Block a user