diff options
| author | Shauren <shauren.trinity@gmail.com> | 2017-07-23 23:32:20 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2017-07-29 15:04:45 +0200 |
| commit | d24ce1739a799042d5a164794c09674227c8572c (patch) | |
| tree | 22a4985cf3be88b2ea3d728dd12c7492b3f4f65e /src/server | |
| parent | 9cbacb56da20b4242d6acd65c4a1babfec4e8158 (diff) | |
Core/Misc: Util changes
* Move IteratorPair to its own header
* Add AsUnderlyingType function to cast enum value to its underlying type (avoids repeating std::underlying_type everywhere)
(cherry picked from commit fdd9227b232db9aae9bc4b2c60ca4de2cdaa0b54)
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/game/Chat/Chat.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Combat/ThreatManager.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index d8a28c2cc57..46c6a26760c 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -416,7 +416,7 @@ bool ChatHandler::_ParseCommands(char const* text) { if (ExecuteCommandInTable(getCommandTable(), text, text)) return true; - + // Pretend commands don't exist for regular players if (m_session && !m_session->HasPermission(rbac::RBAC_PERM_COMMANDS_NOTIFY_COMMAND_NOT_FOUND_ERROR)) return false; @@ -1316,7 +1316,7 @@ bool AddonChannelCommandHandler::ParseCommands(char const* str) if (!str[13] || !str[14] || !str[15] || !str[16]) // str[13] through str[16] is 4-character command counter return false; echo = str+13; - + switch (opcode) { case 'p': // p Ping diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h index a6432d62216..21d975ccea1 100644 --- a/src/server/game/Combat/ThreatManager.h +++ b/src/server/game/Combat/ThreatManager.h @@ -20,11 +20,11 @@ #define _THREATMANAGER #include "Common.h" +#include "IteratorPair.h" #include "SharedDefines.h" #include "LinkedReference/Reference.h" #include "UnitEvents.h" #include "ObjectGuid.h" -#include "Containers.h" #include <list> @@ -220,8 +220,8 @@ class TC_GAME_API ThreatManager { public: // -- compatibility layer for combat rewrite (PR #19930) - Trinity::Containers::IteratorPair<std::list<ThreatReference*>::const_iterator> GetSortedThreatList() const { auto& list = iThreatContainer.getThreatList(); return { list.cbegin(), list.cend() }; } - Trinity::Containers::IteratorPair<std::list<ThreatReference*>::const_iterator> GetUnsortedThreatList() const { return GetSortedThreatList(); } + Trinity::IteratorPair<std::list<ThreatReference*>::const_iterator> GetSortedThreatList() const { auto& list = iThreatContainer.getThreatList(); return { list.cbegin(), list.cend() }; } + Trinity::IteratorPair<std::list<ThreatReference*>::const_iterator> GetUnsortedThreatList() const { return GetSortedThreatList(); } std::list<ThreatReference*> GetModifiableThreatList() const { return iThreatContainer.getThreatList(); } Unit* SelectVictim() { return getHostilTarget(); } Unit* GetCurrentVictim() const { if (ThreatReference* ref = getCurrentVictim()) return ref->GetVictim(); else return nullptr; } |
