From e3da95f16a63cd014ded2ddbd588e1bda106936c Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 29 Mar 2009 17:15:37 -0600 Subject: [7578] Replace generic [7577] implememtaion by more explicit code. Author: VladimirMangos This must restore build at Unix/Linux. --HG-- branch : trunk --- src/game/Map.h | 16 ---------------- src/game/Object.cpp | 12 +++++++++--- 2 files changed, 9 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/game/Map.h b/src/game/Map.h index 853f8e7ed9c..83cb1009669 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -396,22 +396,6 @@ class TRINITY_DLL_SPEC Map : public GridRefManager, public Trinity::O void SendToPlayers(WorldPacket const* data) const; - /*template - void BroadcastWorker(Do& _do) const - { - for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) - _do(itr->getSource()); - } - - template - void BroadcastWorker(Do& _do, uint32 zoneid) const - { - for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) - if(itr->getSource()->GetZoneId()==zoneid) - _do(itr->getSource()); - }*/ - - typedef MapRefManager PlayerList; PlayerList const& GetPlayers() const { return m_mapRefManager; } diff --git a/src/game/Object.cpp b/src/game/Object.cpp index c47c3625160..3189c3123ed 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1518,9 +1518,15 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid) { - //MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid); - //MaNGOS::LocalizedPacketDo say_do(say_build); - //GetMap()->BroadcastWorker(say_do,GetZoneId()); + MaNGOS::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid); + MaNGOS::LocalizedPacketDo say_do(say_build); + + uint32 zoneid = GetZoneId(); + + Map::PlayerList const& pList = GetMap()->GetPlayers(); + for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr) + if(itr->getSource()->GetZoneId()==zoneid) + say_do(itr->getSource()); } void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote) -- cgit v1.2.3