Core/WorldStates: Migrate instance script worldstates to new system
This commit is contained in:
1 parent
fe7e42b0b8
commit
12b60099f8
18 files changed
+90
-392
No files matched your search
@@ -40,6 +40,7 @@
|
||||
#include "ScriptReloadMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
#include "WorldStateMgr.h"
|
||||
#include <cstdarg>
|
||||
#include <sstream>
|
||||
|
||||
@@ -575,18 +576,9 @@ void InstanceScript::DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn /
|
||||
TC_LOG_DEBUG("scripts", "InstanceScript: DoRespawnGameObject failed");
|
||||
}
|
||||
|
||||
void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
void InstanceScript::DoUpdateWorldState(int32 worldStateId, int32 value)
|
||||
{
|
||||
Map::PlayerList const& lPlayers = instance->GetPlayers();
|
||||
|
||||
if (!lPlayers.isEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
player->SendUpdateWorldState(uiStateId, uiStateData);
|
||||
}
|
||||
else
|
||||
TC_LOG_DEBUG("scripts", "DoUpdateWorldState attempt send data but no players in map.");
|
||||
sWorldStateMgr->SetValue(worldStateId, value, instance);
|
||||
}
|
||||
|
||||
// Send Notify to all players in instance
|
||||
|
||||
Reference in new issue
Block a user