summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/AI/CreatureAI.cpp4
-rw-r--r--src/server/game/Texts/CreatureTextMgr.cpp22
-rw-r--r--src/server/game/Texts/CreatureTextMgr.h14
3 files changed, 20 insertions, 20 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 5560624ce4..17cf85115b 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -51,9 +51,9 @@ void CreatureAI::OnCharmed(bool /*apply*/)
AISpellInfoType* UnitAI::AISpellInfo;
AISpellInfoType* GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; }
-void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= nullptr*/)
+void CreatureAI::Talk(uint8 id, WorldObject const* target /*= nullptr*/)
{
- sCreatureTextMgr->SendChat(me, id, whisperTarget);
+ sCreatureTextMgr->SendChat(me, id, target);
}
inline bool IsValidCombatTarget(Creature* source, Player* target)
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 7abaaef7fd..086367ba2b 100644
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -196,7 +196,7 @@ void CreatureTextMgr::LoadCreatureTextLocales()
LOG_INFO("server.loading", " ");
}
-uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget /*= nullptr*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, TeamId teamId /*= TEAM_NEUTRAL*/, bool gmOnly /*= false*/, Player* srcPlr /*= nullptr*/)
+uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject const* target /*= nullptr*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, TeamId teamId /*= TEAM_NEUTRAL*/, bool gmOnly /*= false*/, Player* srcPlr /*= nullptr*/)
{
if (!source)
return 0;
@@ -282,7 +282,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
range = iter->TextRange;
if (finalSound)
- SendSound(source, finalSound, finalType, whisperTarget, range, teamId, gmOnly);
+ SendSound(source, finalSound, finalType, target, range, teamId, gmOnly);
Unit* finalSource = source;
if (srcPlr)
@@ -293,13 +293,13 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
if (srcPlr)
{
- PlayerTextBuilder builder(source, finalSource, finalSource->getGender(), finalType, iter->group, iter->id, finalLang, whisperTarget);
- SendChatPacket(finalSource, builder, finalType, whisperTarget, range, teamId, gmOnly);
+ PlayerTextBuilder builder(source, finalSource, finalSource->getGender(), finalType, iter->group, iter->id, finalLang, target);
+ SendChatPacket(finalSource, builder, finalType, target, range, teamId, gmOnly);
}
else
{
- CreatureTextBuilder builder(finalSource, finalSource->getGender(), finalType, iter->group, iter->id, finalLang, whisperTarget);
- SendChatPacket(finalSource, builder, finalType, whisperTarget, range, teamId, gmOnly);
+ CreatureTextBuilder builder(finalSource, finalSource->getGender(), finalType, iter->group, iter->id, finalLang, target);
+ SendChatPacket(finalSource, builder, finalType, target, range, teamId, gmOnly);
}
if (isEqualChanced || (!isEqualChanced && totalChance == 100.0f))
SetRepeatId(source, textGroup, iter->id);
@@ -326,17 +326,17 @@ float CreatureTextMgr::GetRangeForChatType(ChatMsg msgType) const
return dist;
}
-void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, TeamId teamId, bool gmOnly)
+void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* target, CreatureTextRange range, TeamId teamId, bool gmOnly)
{
if (!sound || !source)
return;
WorldPacket data(SMSG_PLAY_SOUND, 4);
data << uint32(sound);
- SendNonChatPacket(source, &data, msgType, whisperTarget, range, teamId, gmOnly);
+ SendNonChatPacket(source, &data, msgType, target, range, teamId, gmOnly);
}
-void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, TeamId teamId, bool gmOnly) const
+void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* target, CreatureTextRange range, TeamId teamId, bool gmOnly) const
{
float dist = GetRangeForChatType(msgType);
@@ -347,10 +347,10 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data,
{
if (range == TEXT_RANGE_NORMAL)//ignores team and gmOnly
{
- if (!whisperTarget || whisperTarget->GetTypeId() != TYPEID_PLAYER)
+ if (!target || target->GetTypeId() != TYPEID_PLAYER)
return;
- whisperTarget->ToPlayer()->GetSession()->SendPacket(data);
+ target->ToPlayer()->GetSession()->SendPacket(data);
return;
}
break;
diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h
index aa54ad798f..3cff000d8a 100644
--- a/src/server/game/Texts/CreatureTextMgr.h
+++ b/src/server/game/Texts/CreatureTextMgr.h
@@ -94,21 +94,21 @@ public:
void LoadCreatureTextLocales();
CreatureTextMap const& GetTextMap() const { return mTextMap; }
- void SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, TeamId teamId, bool gmOnly);
+ void SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* target, CreatureTextRange range, TeamId teamId, bool gmOnly);
void SendEmote(Unit* source, uint32 emote);
//if sent, returns the 'duration' of the text else 0 if error
- uint32 SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget = nullptr, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, CreatureTextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, TeamId teamId = TEAM_NEUTRAL, bool gmOnly = false, Player* srcPlr = nullptr);
+ uint32 SendChat(Creature* source, uint8 textGroup, WorldObject const* target = nullptr, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, CreatureTextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, TeamId teamId = TEAM_NEUTRAL, bool gmOnly = false, Player* srcPlr = nullptr);
bool TextExist(uint32 sourceEntry, uint8 textGroup);
std::string GetLocalizedChatString(uint32 entry, uint8 gender, uint8 textGroup, uint32 id, LocaleConstant locale) const;
- template<class Builder> void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, TeamId teamId = TEAM_NEUTRAL, bool gmOnly = false) const;
+ template<class Builder> void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* target = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, TeamId teamId = TEAM_NEUTRAL, bool gmOnly = false) const;
private:
CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup);
void SetRepeatId(Creature* source, uint8 textGroup, uint8 id);
- void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* whisperTarget, CreatureTextRange range, TeamId teamId, bool gmOnly) const;
+ void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, WorldObject const* target, CreatureTextRange range, TeamId teamId, bool gmOnly) const;
float GetRangeForChatType(ChatMsg msgType) const;
CreatureTextMap mTextMap;
@@ -177,7 +177,7 @@ private:
};
template<class Builder>
-void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget /*= nullptr*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, TeamId teamId /*= TEAM_NEUTRAL*/, bool gmOnly /*= false*/) const
+void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* target /*= nullptr*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, TeamId teamId /*= TEAM_NEUTRAL*/, bool gmOnly /*= false*/) const
{
if (!source)
return;
@@ -191,10 +191,10 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder
{
if (range == TEXT_RANGE_NORMAL) //ignores team and gmOnly
{
- if (!whisperTarget || whisperTarget->GetTypeId() != TYPEID_PLAYER)
+ if (!target || target->GetTypeId() != TYPEID_PLAYER)
return;
- localizer(const_cast<Player*>(whisperTarget->ToPlayer()));
+ localizer(const_cast<Player*>(target->ToPlayer()));
return;
}
break;