diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2020-09-04 00:58:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-04 00:58:23 +0200 |
| commit | 88d446dadf65bf47c72d3042834281233b1174ac (patch) | |
| tree | 3e111e59e2241712bc82c627fdcb3e8ed9a9cf51 /src/server/game/Entities/Unit | |
| parent | 35b3ba90b03143f2dc700cc4baeb88a58089c102 (diff) | |
Scripts/Commands: Convert argument parsing of .npc commands
(And I snuck some chat command cleanup in there, more de-cluttering!)
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 10 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0548d76883a..201787159bd 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13459,7 +13459,7 @@ bool Unit::IsHighestExclusiveAuraEffect(SpellInfo const* spellInfo, AuraType aur return true; } -void Unit::Talk(std::string const& text, ChatMsg msgType, Language language, float textRange, WorldObject const* target) +void Unit::Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const* target) { Trinity::CustomChatTextBuilder builder(this, msgType, text, language, target); Trinity::LocalizedPacketDo<Trinity::CustomChatTextBuilder> localizer(builder); @@ -13467,22 +13467,22 @@ void Unit::Talk(std::string const& text, ChatMsg msgType, Language language, flo Cell::VisitWorldObjects(this, worker, textRange); } -void Unit::Say(std::string const& text, Language language, WorldObject const* target /*= nullptr*/) +void Unit::Say(std::string_view text, Language language, WorldObject const* target /*= nullptr*/) { Talk(text, CHAT_MSG_MONSTER_SAY, language, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), target); } -void Unit::Yell(std::string const& text, Language language, WorldObject const* target /*= nullptr*/) +void Unit::Yell(std::string_view text, Language language, WorldObject const* target /*= nullptr*/) { Talk(text, CHAT_MSG_MONSTER_YELL, language, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), target); } -void Unit::TextEmote(std::string const& text, WorldObject const* target /*= nullptr*/, bool isBossEmote /*= false*/) +void Unit::TextEmote(std::string_view text, WorldObject const* target /*= nullptr*/, bool isBossEmote /*= false*/) { Talk(text, isBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, LANG_UNIVERSAL, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target); } -void Unit::Whisper(std::string const& text, Language language, Player* target, bool isBossWhisper /*= false*/) +void Unit::Whisper(std::string_view text, Language language, Player* target, bool isBossWhisper /*= false*/) { if (!target) return; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index c83f2e5edd5..073087163d4 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1673,11 +1673,11 @@ class TC_GAME_API Unit : public WorldObject bool IsHighestExclusiveAura(Aura const* aura, bool removeOtherAuraApplications = false); bool IsHighestExclusiveAuraEffect(SpellInfo const* spellInfo, AuraType auraType, int32 effectAmount, uint8 auraEffectMask, bool removeOtherAuraApplications = false); - virtual void Talk(std::string const& text, ChatMsg msgType, Language language, float textRange, WorldObject const* target); - virtual void Say(std::string const& text, Language language, WorldObject const* target = nullptr); - virtual void Yell(std::string const& text, Language language, WorldObject const* target = nullptr); - virtual void TextEmote(std::string const& text, WorldObject const* target = nullptr, bool isBossEmote = false); - virtual void Whisper(std::string const& text, Language language, Player* target, bool isBossWhisper = false); + virtual void Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const* target); + virtual void Say(std::string_view text, Language language, WorldObject const* target = nullptr); + virtual void Yell(std::string_view text, Language language, WorldObject const* target = nullptr); + virtual void TextEmote(std::string_view text, WorldObject const* target = nullptr, bool isBossEmote = false); + virtual void Whisper(std::string_view text, Language language, Player* target, bool isBossWhisper = false); virtual void Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject const* target); virtual void Say(uint32 textId, WorldObject const* target = nullptr); virtual void Yell(uint32 textId, WorldObject const* target = nullptr); |
