Core/Packet: WorldState (#9435)

* Core/Packet: WorldState

* Test

* WRONG

Co-authored-by: acidmanifesto <joshua.lee.betts@gmail.com>
This commit is contained in:
IntelligentQuantum
2022-01-03 20:20:56 +03:30
committed by GitHub
parent 7209f65896
commit e57582accb
15 changed files with 148 additions and 51 deletions

View File

@@ -31,7 +31,7 @@
#include "UnitAI.h"
#include "Util.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldStatePackets.h"
#include <time.h>
GameEventMgr* GameEventMgr::instance()
@@ -1620,9 +1620,10 @@ void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate)
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
if (bl && bl->HolidayWorldStateId)
{
WorldPacket data;
sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, bl->HolidayWorldStateId, Activate ? 1 : 0);
sWorld->SendGlobalMessage(&data);
WorldPackets::WorldState::UpdateWorldState worldstate;
worldstate.VariableID = bl->HolidayWorldStateId;
worldstate.Value = Activate ? 1 : 0;
sWorld->SendGlobalMessage(worldstate.Write());
}
}
}