mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Merge [SD2]
r1276 Add function DoUpdateWorldState() to ScriptedInstance class for sending update to all players in instance. --HG-- branch : trunk
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "InstanceData.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Map.h"
|
||||
#include "Player.h"
|
||||
#include "GameObject.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
@@ -279,3 +280,19 @@ void InstanceData::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
pGo->SetRespawnTime(uiTimeToDespawn);
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
{
|
||||
Map::PlayerList const& lPlayers = instance->GetPlayers();
|
||||
|
||||
if (!lPlayers.isEmpty())
|
||||
{
|
||||
for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
|
||||
{
|
||||
if (Player* pPlayer = itr->getSource())
|
||||
pPlayer->SendUpdateWorldState(uiStateId, uiStateData);
|
||||
}
|
||||
}
|
||||
else
|
||||
debug_log("TSCR: DoUpdateWorldState attempt send data but no players in map.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user