From 6da2105aa9992af48b359c3c3f21d105f4f9cb9b Mon Sep 17 00:00:00 2001 From: n0n4m3 Date: Fri, 18 Dec 2009 06:37:36 +0100 Subject: Restore work Wintergrasp timer by Chesterfield --HG-- branch : trunk --- src/game/OutdoorPvPWG.cpp | 14 ++++++-------- src/game/OutdoorPvPWG.h | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/game/OutdoorPvPWG.cpp b/src/game/OutdoorPvPWG.cpp index 28cf16645e6..94389f1c812 100644 --- a/src/game/OutdoorPvPWG.cpp +++ b/src/game/OutdoorPvPWG.cpp @@ -801,14 +801,14 @@ void OutdoorPvPWG::SendInitWorldStatesTo(Player *player) const data << uint32(571); data << uint32(ZONE_WINTERGRASP); data << uint32(0); - data << uint16(4+5+4+m_buildingStates.size()); + data << uint16(4+2+4+m_buildingStates.size()); data << uint32(3803) << uint32(getDefenderTeam() == TEAM_ALLIANCE ? 1 : 0); data << uint32(3802) << uint32(getDefenderTeam() != TEAM_ALLIANCE ? 1 : 0); data << uint32(3801) << uint32(isWarTime() ? 0 : 1); data << uint32(3710) << uint32(isWarTime() ? 1 : 0); - for (uint32 i = 0; i < 5; ++i) + for (uint32 i = 0; i < 2; ++i) data << ClockWorldState[i] << m_clock[i]; data << uint32(3490) << uint32(m_vehicles[TEAM_HORDE].size()); @@ -1219,19 +1219,17 @@ void OutdoorPvPWG::UpdateClockDigit(uint32 &timer, uint32 digit, uint32 mod) if (m_clock[digit] != value) { m_clock[digit] = value; - SendUpdateWorldState(ClockWorldState[digit], value); + SendUpdateWorldState(ClockWorldState[digit], (timer + time(NULL))); } } void OutdoorPvPWG::UpdateClock() { uint32 timer = m_timer / 1000; - UpdateClockDigit(timer, 0, 10); - UpdateClockDigit(timer, 1, 6); - UpdateClockDigit(timer, 2, 10); - UpdateClockDigit(timer, 3, 6); if (!isWarTime()) - UpdateClockDigit(timer, 4, 10); + UpdateClockDigit(timer, 1, 10); + else + UpdateClockDigit(timer, 0, 10); } bool OutdoorPvPWG::Update(uint32 diff) diff --git a/src/game/OutdoorPvPWG.h b/src/game/OutdoorPvPWG.h index 63381b15f7b..c9700fe5123 100644 --- a/src/game/OutdoorPvPWG.h +++ b/src/game/OutdoorPvPWG.h @@ -29,7 +29,7 @@ const uint32 WintergraspFaction[3] = {1732, 1735, 35}; const uint32 WG_MARK_OF_HONOR = 43589; const uint32 VehNumWorldState[2] = {3680,3490}; const uint32 MaxVehNumWorldState[2] = {3681,3491}; -const uint32 ClockWorldState[5] = {3785,3784,3782,3976,3975}; +const uint32 ClockWorldState[2] = {3781,4354}; enum OutdoorPvPWGSpell { @@ -268,7 +268,7 @@ class OutdoorPvPWG : public OutdoorPvP bool m_wartime; bool m_changeDefender; uint32 m_timer; - uint32 m_clock[5]; + uint32 m_clock[2]; uint32 m_workshopCount[2]; uint32 m_towerDestroyedCount[2]; uint32 m_towerDamagedCount[2]; -- cgit v1.2.3