mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Game: Include cleanup part 5
* ObjectMgr.h * Player.h * Unit.h * G3D should no longer propagate everywhere from Spline/MotionMaster
This commit is contained in:
@@ -16,17 +16,18 @@
|
||||
*/
|
||||
|
||||
#include "CreatureTextMgr.h"
|
||||
#include "Cell.h"
|
||||
#include "CreatureTextMgrImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Chat.h"
|
||||
#include "ChatPackets.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "Log.h"
|
||||
#include "MiscPackets.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
class CreatureTextBuilder
|
||||
{
|
||||
@@ -225,7 +226,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
|
||||
}
|
||||
|
||||
CreatureTextGroup const& textGroupContainer = itr->second; //has all texts in the group
|
||||
CreatureTextRepeatIds repeatGroup = GetRepeatGroup(source, textGroup);//has all textIDs from the group that were already said
|
||||
CreatureTextRepeatIds repeatGroup = source->GetTextRepeatGroup(textGroup);//has all textIDs from the group that were already said
|
||||
CreatureTextGroup tempGroup;//will use this to talk after sorting repeatGroup
|
||||
|
||||
for (CreatureTextGroup::const_iterator giter = textGroupContainer.begin(); giter != textGroupContainer.end(); ++giter)
|
||||
@@ -276,7 +277,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
|
||||
SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
|
||||
}
|
||||
|
||||
SetRepeatId(source, textGroup, iter->id);
|
||||
source->SetTextRepeatId(textGroup, iter->id);
|
||||
return iter->duration;
|
||||
}
|
||||
|
||||
@@ -348,7 +349,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
|
||||
Map::PlayerList const& players = source->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (itr->GetSource()->GetAreaId() == areaId && (!team || Team(itr->GetSource()->GetTeam()) == team) && (!gmOnly || itr->GetSource()->IsGameMaster()))
|
||||
itr->GetSource()->GetSession()->SendPacket(data);
|
||||
itr->GetSource()->SendDirectMessage(data);
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_ZONE:
|
||||
@@ -357,7 +358,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
|
||||
Map::PlayerList const& players = source->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (itr->GetSource()->GetZoneId() == zoneId && (!team || Team(itr->GetSource()->GetTeam()) == team) && (!gmOnly || itr->GetSource()->IsGameMaster()))
|
||||
itr->GetSource()->GetSession()->SendPacket(data);
|
||||
itr->GetSource()->SendDirectMessage(data);
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_MAP:
|
||||
@@ -365,7 +366,7 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
|
||||
Map::PlayerList const& players = source->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if ((!team || Team(itr->GetSource()->GetTeam()) == team) && (!gmOnly || itr->GetSource()->IsGameMaster()))
|
||||
itr->GetSource()->GetSession()->SendPacket(data);
|
||||
itr->GetSource()->SendDirectMessage(data);
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_WORLD:
|
||||
@@ -373,8 +374,8 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
|
||||
SessionMap const& smap = sWorld->GetAllSessions();
|
||||
for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
|
||||
if (Player* player = iter->second->GetPlayer())
|
||||
if (player->GetSession() && (!team || Team(player->GetTeam()) == team) && (!gmOnly || player->IsGameMaster()))
|
||||
player->GetSession()->SendPacket(data);
|
||||
if ((!team || Team(player->GetTeam()) == team) && (!gmOnly || player->IsGameMaster()))
|
||||
player->SendDirectMessage(data);
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_NORMAL:
|
||||
@@ -394,21 +395,6 @@ void CreatureTextMgr::SendEmote(Unit* source, uint32 emote)
|
||||
source->HandleEmoteCommand(emote);
|
||||
}
|
||||
|
||||
void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id)
|
||||
{
|
||||
if (!source)
|
||||
return;
|
||||
|
||||
source->SetTextRepeatId(textGroup, id);
|
||||
}
|
||||
|
||||
CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup) const
|
||||
{
|
||||
ASSERT(source);//should never happen
|
||||
|
||||
return source->GetTextRepeatGroup(textGroup);
|
||||
}
|
||||
|
||||
bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) const
|
||||
{
|
||||
if (!sourceEntry)
|
||||
|
||||
Reference in New Issue
Block a user