Merge pull request #14976 from robinsch/wgTimer

Core/WorldState: WG Interface timer
Closes issue  #14913
This commit is contained in:
mik1893 committed 2015-06-29 19:39:26 +02:00
commit c8df10dbc0
1 file changed
+3 -7
+3 -7
View File
@@ -9616,13 +9616,9 @@ void Player::SendBattlefieldWorldStates()
{
if (BattlefieldWG* wg = (BattlefieldWG*)sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
{
if (wg->IsWarTime())
SendUpdateWorldState(ClockWorldState[1], uint32(time(NULL)));
else // Time to next battle
{
uint32 timer = wg->GetTimer() / 1000;
SendUpdateWorldState(ClockWorldState[1], time(NULL) + timer);
}
SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, wg->IsWarTime() ? 0 : 1);
uint32 timer = wg->IsWarTime() ? 0 : (wg->GetTimer() / 1000); // 0 - Time to next battle
SendUpdateWorldState(ClockWorldState[1], uint32(time(NULL) + timer));
}
}
}