diff options
24 files changed, 94 insertions, 95 deletions
diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index 85e52887655..c53dde9d770 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -23,6 +23,7 @@ #include "Random.h" #include <algorithm> #include <iterator> +#include <span> #include <stdexcept> #include <type_traits> #include <utility> @@ -122,7 +123,7 @@ namespace Trinity * Note: container cannot be empty */ template<class C> - inline auto SelectRandomWeightedContainerElement(C const& container, std::vector<double> const& weights) -> decltype(std::begin(container)) + inline auto SelectRandomWeightedContainerElement(C const& container, std::span<double> const& weights) -> decltype(std::begin(container)) { auto it = std::begin(container); std::advance(it, urandweighted(weights.size(), weights.data())); @@ -140,19 +141,21 @@ namespace Trinity template<class C, class Fn> inline auto SelectRandomWeightedContainerElement(C const& container, Fn weightExtractor) -> decltype(std::begin(container)) { - std::vector<double> weights; - weights.reserve(std::size(container)); + std::size_t size = std::size(container); + std::size_t i = 0; + double* weights = new double[size]; double weightSum = 0.0; - for (auto& val : container) + for (auto const& val : container) { double weight = weightExtractor(val); - weights.push_back(weight); + weights[i++] = weight; weightSum += weight; } - if (weightSum <= 0.0) - weights.assign(std::size(container), 1.0); - return SelectRandomWeightedContainerElement(container, weights); + auto it = std::begin(container); + std::advance(it, weightSum > 0.0 ? urandweighted(size, weights) : urand(0, uint32(std::size(container)) - 1)); + delete[] weights; + return it; } /** diff --git a/src/server/database/Database/MySQLConnection.cpp b/src/server/database/Database/MySQLConnection.cpp index 139b0d45c41..b5600a831ff 100644 --- a/src/server/database/Database/MySQLConnection.cpp +++ b/src/server/database/Database/MySQLConnection.cpp @@ -479,7 +479,7 @@ MySQLPreparedStatement* MySQLConnection::GetPreparedStatement(uint32 index) return ret; } -void MySQLConnection::PrepareStatement(uint32 index, std::string const& sql, ConnectionFlags flags) +void MySQLConnection::PrepareStatement(uint32 index, std::string_view sql, ConnectionFlags flags) { // Check if specified query should be prepared on this connection // i.e. don't prepare async statements on synchronous connections @@ -499,7 +499,7 @@ void MySQLConnection::PrepareStatement(uint32 index, std::string const& sql, Con } else { - if (mysql_stmt_prepare(stmt, sql.c_str(), static_cast<unsigned long>(sql.size()))) + if (mysql_stmt_prepare(stmt, sql.data(), static_cast<unsigned long>(sql.size()))) { TC_LOG_ERROR("sql.sql", "In mysql_stmt_prepare() id: {}, sql: \"{}\"", index, sql); TC_LOG_ERROR("sql.sql", "{}", mysql_stmt_error(stmt)); @@ -507,7 +507,7 @@ void MySQLConnection::PrepareStatement(uint32 index, std::string const& sql, Con m_prepareError = true; } else - m_stmts[index] = std::make_unique<MySQLPreparedStatement>(reinterpret_cast<MySQLStmt*>(stmt), sql); + m_stmts[index] = std::make_unique<MySQLPreparedStatement>(reinterpret_cast<MySQLStmt*>(stmt), std::string(sql)); } } diff --git a/src/server/database/Database/MySQLConnection.h b/src/server/database/Database/MySQLConnection.h index 2dad920cdd5..63fcc03141b 100644 --- a/src/server/database/Database/MySQLConnection.h +++ b/src/server/database/Database/MySQLConnection.h @@ -92,7 +92,7 @@ class TC_DATABASE_API MySQLConnection uint32 GetServerVersion() const; MySQLPreparedStatement* GetPreparedStatement(uint32 index); - void PrepareStatement(uint32 index, std::string const& sql, ConnectionFlags flags); + void PrepareStatement(uint32 index, std::string_view sql, ConnectionFlags flags); virtual void DoPrepareStatements() = 0; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index d4af11f7dad..475b4ad4ad5 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1643,9 +1643,19 @@ struct SmartScriptHolder operator bool() const { return entryOrGuid != 0; } // Default comparision operator using priority field as first ordering field - bool operator<(SmartScriptHolder const& other) const + std::strong_ordering operator<=>(SmartScriptHolder const& right) const { - return std::tie(priority, entryOrGuid, source_type, event_id, link) < std::tie(other.priority, other.entryOrGuid, other.source_type, other.event_id, other.link); + if (auto cmp = priority <=> right.priority; std::is_neq(cmp)) + return cmp; + if (auto cmp = entryOrGuid <=> right.entryOrGuid; std::is_neq(cmp)) + return cmp; + if (auto cmp = source_type <=> right.source_type; std::is_neq(cmp)) + return cmp; + if (auto cmp = event_id <=> right.event_id; std::is_neq(cmp)) + return cmp; + if (auto cmp = link <=> right.link; std::is_neq(cmp)) + return cmp; + return std::strong_ordering::equal; } static constexpr uint32 DEFAULT_PRIORITY = std::numeric_limits<uint32>::max(); diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index d609d683fe7..c7808947032 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -820,7 +820,7 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId) } } - return *Trinity::Containers::SelectRandomWeightedContainerElement(ids, weights); + return *Trinity::Containers::SelectRandomWeightedContainerElement(ids, std::span(weights)); } return BATTLEGROUND_TYPE_NONE; diff --git a/src/server/game/Chat/ChatCommands/ChatCommand.cpp b/src/server/game/Chat/ChatCommands/ChatCommand.cpp index 14fecb6ee33..e920d7c8cf6 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommand.cpp +++ b/src/server/game/Chat/ChatCommands/ChatCommand.cpp @@ -31,13 +31,14 @@ using ChatSubCommandMap = std::map<std::string_view, Trinity::Impl::ChatCommands void Trinity::Impl::ChatCommands::ChatCommandNode::LoadFromBuilder(ChatCommandBuilder const& builder) { - if (std::holds_alternative<ChatCommandBuilder::InvokerEntry>(builder._data)) + if (ChatCommandBuilder::InvokerEntry const* invokerEntry = std::get_if<ChatCommandBuilder::InvokerEntry>(&builder._data)) { ASSERT(!_invoker, "Duplicate blank sub-command."); - TrinityStrings help; - std::tie(_invoker, help, _permission) = *(std::get<ChatCommandBuilder::InvokerEntry>(builder._data)); - if (help) - _help.emplace<TrinityStrings>(help); + _invoker = invokerEntry->_invoker; + if (invokerEntry->_help) + _help.emplace<TrinityStrings>(invokerEntry->_help); + + _permission = invokerEntry->_permissions; } else LoadCommandsIntoMap(this, _subCommands, std::get<ChatCommandBuilder::SubCommandEntry>(builder._data)); diff --git a/src/server/game/Chat/ChatCommands/ChatCommand.h b/src/server/game/Chat/ChatCommands/ChatCommand.h index 49a3a3032b3..80996348c66 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommand.h +++ b/src/server/game/Chat/ChatCommands/ChatCommand.h @@ -227,8 +227,6 @@ namespace Trinity::ChatCommands Trinity::Impl::ChatCommands::CommandInvoker _invoker; TrinityStrings _help; Trinity::Impl::ChatCommands::CommandPermissions _permissions; - - auto operator*() const { return std::tie(_invoker, _help, _permissions); } }; using SubCommandEntry = std::reference_wrapper<std::vector<ChatCommandBuilder> const>; diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index 25e8226192a..704fc872034 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -331,10 +331,7 @@ public: int32 PushID = 0; uint32 UniqueID = 0; - friend bool operator<(HotfixId const& left, HotfixId const& right) - { - return std::tie(left.PushID, left.UniqueID) < std::tie(right.PushID, right.UniqueID); - } + friend std::strong_ordering operator<=>(HotfixId const& left, HotfixId const& right) = default; }; struct HotfixRecord @@ -353,9 +350,15 @@ public: HotfixId ID; Status HotfixStatus = Status::Invalid; - friend bool operator<(HotfixRecord const& left, HotfixRecord const& right) + friend std::strong_ordering operator<=>(HotfixRecord const& left, HotfixRecord const& right) { - return std::tie(left.ID, left.TableHash, left.RecordID) < std::tie(right.ID, right.TableHash, right.RecordID); + if (auto cmp = left.ID <=> right.ID; std::is_neq(cmp)) + return cmp; + if (auto cmp = left.TableHash <=> right.TableHash; std::is_neq(cmp)) + return cmp; + if (auto cmp = left.RecordID <=> right.RecordID; std::is_neq(cmp)) + return cmp; + return std::strong_ordering::equal; } }; diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index aa5112ff5c8..f6bb3164ccd 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -70,7 +70,7 @@ void FormationMgr::AddCreatureToGroup(ObjectGuid::LowType leaderSpawnId, Creatur //Create new group TC_LOG_DEBUG("entities.unit", "Group not found: {}. Creating new group.", leaderSpawnId); CreatureGroup* group = new CreatureGroup(leaderSpawnId); - std::tie(itr, std::ignore) = map->CreatureGroupHolder.emplace(leaderSpawnId, group); + itr = map->CreatureGroupHolder.emplace(leaderSpawnId, group).first; } itr->second->AddMember(creature); diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index 53b0ba6a375..1c4f55c4c81 100644 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -100,7 +100,7 @@ ItemRandomBonusListId GenerateItemRandomBonusListId(uint32 item_id) return 0; } - return *Trinity::Containers::SelectRandomWeightedContainerElement(tab->second.BonusListIDs, tab->second.Chances); + return *Trinity::Containers::SelectRandomWeightedContainerElement(tab->second.BonusListIDs, std::span(tab->second.Chances)); } TC_GAME_API float GetRandomPropertyPoints(uint32 itemLevel, uint32 quality, uint32 inventoryType, uint32 subClass) diff --git a/src/server/game/Entities/Object/ObjectGuid.h b/src/server/game/Entities/Object/ObjectGuid.h index 670fe8bf240..b24fb1e7707 100644 --- a/src/server/game/Entities/Object/ObjectGuid.h +++ b/src/server/game/Entities/Object/ObjectGuid.h @@ -329,16 +329,14 @@ class TC_GAME_API ObjectGuid bool IsCast() const { return GetHigh() == HighGuid::Cast; } bool operator!() const { return IsEmpty(); } - bool operator== (ObjectGuid const& guid) const { return _data[0] == guid._data[0] && _data[1] == guid._data[1]; } - bool operator!= (ObjectGuid const& guid) const { return !(*this == guid); } - bool operator< (ObjectGuid const& guid) const + bool operator==(ObjectGuid const& right) const = default; + std::strong_ordering operator<=>(ObjectGuid const& right) const { - if (_data[1] < guid._data[1]) - return true; - else if (_data[1] > guid._data[1]) - return false; - - return _data[0] < guid._data[0]; + if (std::strong_ordering cmp = _data[1] <=> right._data[1]; std::is_neq(cmp)) + return cmp; + if (std::strong_ordering cmp = _data[0] <=> right._data[0]; std::is_neq(cmp)) + return cmp; + return std::strong_ordering::equal; } static char const* GetTypeName(HighGuid high); diff --git a/src/server/game/Entities/Player/CollectionMgr.cpp b/src/server/game/Entities/Player/CollectionMgr.cpp index 1244a87ab1f..7868afe5ab9 100644 --- a/src/server/game/Entities/Player/CollectionMgr.cpp +++ b/src/server/game/Entities/Player/CollectionMgr.cpp @@ -653,8 +653,7 @@ bool CollectionMgr::IsSetCompleted(uint32 transmogSetId) const if (transmogSlot < 0 || knownPieces[transmogSlot] == 1) continue; - bool hasAppearance, isTemporary; - std::tie(hasAppearance, isTemporary) = HasItemAppearance(transmogSetItem->ItemModifiedAppearanceID); + auto [hasAppearance, isTemporary] = HasItemAppearance(transmogSetItem->ItemModifiedAppearanceID); knownPieces[transmogSlot] = (hasAppearance && !isTemporary) ? 1 : 0; } diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index e0123294f66..2c99dfe79cd 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -80,11 +80,7 @@ struct TempSummonGroupKey { } - bool operator<(TempSummonGroupKey const& rhs) const - { - return std::tie(_summonerEntry, _summonerType, _summonGroup) < - std::tie(rhs._summonerEntry, rhs._summonerType, rhs._summonGroup); - } + std::strong_ordering operator<=>(TempSummonGroupKey const& right) const = default; private: uint32 _summonerEntry; ///< Summoner's entry diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 380c5edf068..5e3d31e0a71 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1951,8 +1951,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPackets::EquipmentSet::SaveEquipm if (!sItemModifiedAppearanceStore.LookupEntry(saveEquipmentSet.Set.Appearances[i])) return; - bool hasAppearance, isTemporary; - std::tie(hasAppearance, isTemporary) = GetCollectionMgr()->HasItemAppearance(saveEquipmentSet.Set.Appearances[i]); + auto [hasAppearance, isTemporary] = GetCollectionMgr()->HasItemAppearance(saveEquipmentSet.Set.Appearances[i]); if (!hasAppearance) return; } diff --git a/src/server/game/Handlers/CollectionsHandler.cpp b/src/server/game/Handlers/CollectionsHandler.cpp index f6a5ad124de..1a0ce8be7d1 100644 --- a/src/server/game/Handlers/CollectionsHandler.cpp +++ b/src/server/game/Handlers/CollectionsHandler.cpp @@ -28,8 +28,7 @@ void WorldSession::HandleCollectionItemSetFavorite(WorldPackets::Collections::Co break; case WorldPackets::Collections::APPEARANCE: { - bool hasAppearance, isTemporary; - std::tie(hasAppearance, isTemporary) = GetCollectionMgr()->HasItemAppearance(collectionItemSetFavorite.ID); + auto [hasAppearance, isTemporary] = GetCollectionMgr()->HasItemAppearance(collectionItemSetFavorite.ID); if (!hasAppearance || isTemporary) return; diff --git a/src/server/game/Handlers/TransmogrificationHandler.cpp b/src/server/game/Handlers/TransmogrificationHandler.cpp index 15884d507b6..e067b97f57a 100644 --- a/src/server/game/Handlers/TransmogrificationHandler.cpp +++ b/src/server/game/Handlers/TransmogrificationHandler.cpp @@ -58,8 +58,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPackets::Transmogrification::Tra return false; } - bool hasAppearance, isTemporary; - std::tie(hasAppearance, isTemporary) = GetCollectionMgr()->HasItemAppearance(itemModifiedAppearanceId); + auto [hasAppearance, isTemporary] = GetCollectionMgr()->HasItemAppearance(itemModifiedAppearanceId); if (!hasAppearance) { TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - {}, Name: {} tried to transmogrify using appearance he has not collected ({}).", player->GetGUID().ToString(), player->GetName(), itemModifiedAppearanceId); diff --git a/src/server/game/Loot/LootItemStorage.cpp b/src/server/game/Loot/LootItemStorage.cpp index 826bb4dcec6..152afcc2e76 100644 --- a/src/server/game/Loot/LootItemStorage.cpp +++ b/src/server/game/Loot/LootItemStorage.cpp @@ -67,16 +67,7 @@ void LootItemStorage::LoadStorageFromDB() Field* fields = result->Fetch(); uint64 key = fields[0].GetUInt64(); - auto itr = _lootItemStore.find(key); - if (itr == _lootItemStore.end()) - { - bool added; - std::tie(itr, added) = _lootItemStore.emplace(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(key)); - - ASSERT(added); - } - - StoredLootContainer& storedContainer = itr->second; + StoredLootContainer& storedContainer = _lootItemStore.try_emplace(key, key).first->second; LootItem lootItem; lootItem.itemid = fields[1].GetUInt32(); @@ -114,16 +105,7 @@ void LootItemStorage::LoadStorageFromDB() Field* fields = result->Fetch(); uint64 key = fields[0].GetUInt64(); - auto itr = _lootItemStore.find(key); - if (itr == _lootItemStore.end()) - { - bool added; - std::tie(itr, added) = _lootItemStore.emplace(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(key)); - - ASSERT(added); - } - - StoredLootContainer& storedContainer = itr->second; + StoredLootContainer& storedContainer = _lootItemStore.try_emplace(key, key).first->second; storedContainer.AddMoney(fields[1].GetUInt32(), trans); ++count; diff --git a/src/server/game/Scripting/ScriptReloadMgr.h b/src/server/game/Scripting/ScriptReloadMgr.h index c71aa2d790a..3a0b9f3928e 100644 --- a/src/server/game/Scripting/ScriptReloadMgr.h +++ b/src/server/game/Scripting/ScriptReloadMgr.h @@ -18,10 +18,14 @@ #ifndef SCRIPT_RELOADER_H #define SCRIPT_RELOADER_H +#include "Define.h" #include <memory> #include <string> -#include "Define.h" -#include <boost/filesystem/path.hpp> + +namespace boost::filesystem +{ +class path; +} /// Represents a strong reference to a dynamic library which /// provides C++ scripts. As long as one reference to the library exists diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index b40083c4d87..14cb01ba3fc 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1307,17 +1307,32 @@ uint32 Aura::GetEffectMask() const return effMask; } -void Aura::GetApplicationVector(std::vector<AuraApplication*>& applicationList) const +void Aura::GetApplicationVector(std::vector<AuraApplication*>& applications) const { for (auto const& applicationPair : m_applications) { if (!applicationPair.second->GetEffectMask()) continue; - applicationList.push_back(applicationPair.second); + applications.push_back(applicationPair.second); } } +AuraApplication const* Aura::GetApplicationOfTarget(ObjectGuid guid) const +{ + return Trinity::Containers::MapGetValuePtr(m_applications, guid); +} + +AuraApplication* Aura::GetApplicationOfTarget(ObjectGuid guid) +{ + return Trinity::Containers::MapGetValuePtr(m_applications, guid); +} + +bool Aura::IsAppliedOnTarget(ObjectGuid guid) const +{ + return m_applications.contains(guid); +} + void Aura::SetNeedClientUpdateForTargets() const { for (ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter) diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index d5b193c07dd..aa9829401e0 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -105,12 +105,7 @@ struct AuraKey uint32 SpellId; uint32 EffectMask; - bool operator<(AuraKey const& right) const - { - auto comparisonTuple = [](AuraKey const& k) { return std::tie(k.Caster, k.Item, k.SpellId, k.EffectMask); }; - - return comparisonTuple(*this) < comparisonTuple(right); - } + friend std::strong_ordering operator<=>(AuraKey const& left, AuraKey const& right) = default; }; struct AuraLoadEffectInfo @@ -236,10 +231,10 @@ class TC_GAME_API Aura // Helpers for targets ApplicationMap const& GetApplicationMap() { return m_applications; } - void GetApplicationVector(std::vector<AuraApplication*>& applicationVector) const; - AuraApplication const* GetApplicationOfTarget(ObjectGuid guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; } - AuraApplication* GetApplicationOfTarget(ObjectGuid guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; } - bool IsAppliedOnTarget(ObjectGuid guid) const { return m_applications.find(guid) != m_applications.end(); } + void GetApplicationVector(std::vector<AuraApplication*>& applications) const; + AuraApplication const* GetApplicationOfTarget(ObjectGuid guid) const; + AuraApplication* GetApplicationOfTarget(ObjectGuid guid); + bool IsAppliedOnTarget(ObjectGuid guid) const; void SetNeedClientUpdateForTargets() const; void HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, bool apply, bool onReapply); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index d903c5c9e45..daf57d6a557 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6974,8 +6974,7 @@ SpellCastResult Spell::CheckRange(bool strict) const if (!strict && m_casttime == 0) return SPELL_CAST_OK; - float minRange, maxRange; - std::tie(minRange, maxRange) = GetMinMaxRange(strict); + auto [minRange, maxRange] = GetMinMaxRange(strict); // dont check max_range to strictly after cast if (m_spellInfo->RangeEntry && m_spellInfo->RangeEntry->Flags != SPELL_RANGE_MELEE && !strict) diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index 4f6522147d0..b50039ac3a4 100644 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -73,10 +73,7 @@ struct CreatureTextId { CreatureTextId(uint32 e, uint32 g, uint32 i) : entry(e), textGroup(g), textId(i) { } - bool operator<(CreatureTextId const& right) const - { - return std::tie(entry, textGroup, textId) < std::tie(right.entry, right.textGroup, right.textId); - } + friend std::strong_ordering operator<=>(CreatureTextId const& left, CreatureTextId const& right) = default; uint32 entry; uint32 textGroup; diff --git a/src/server/scripts/ScriptPCH.h b/src/server/scripts/ScriptPCH.h index 31a8e00a2d1..c17231d3f64 100644 --- a/src/server/scripts/ScriptPCH.h +++ b/src/server/scripts/ScriptPCH.h @@ -31,6 +31,7 @@ #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" +#include "SpellAuraEffects.h" #include "SpellMgr.h" #include "SpellScript.h" #include "StringFormat.h" diff --git a/src/server/shared/Networking/AsyncAcceptor.h b/src/server/shared/Networking/AsyncAcceptor.h index e88330ebdba..782fa26f879 100644 --- a/src/server/shared/Networking/AsyncAcceptor.h +++ b/src/server/shared/Networking/AsyncAcceptor.h @@ -46,9 +46,10 @@ public: template<AcceptCallback acceptCallback> void AsyncAcceptWithCallback() { - tcp::socket* socket; - uint32 threadIndex; - std::tie(socket, threadIndex) = _socketFactory(); + auto [tmpSocket, tmpThreadIndex] = _socketFactory(); + // TODO: get rid of temporary variables (clang 15 cannot handle variables from structured bindings as lambda captures) + tcp::socket* socket = tmpSocket; + uint32 threadIndex = tmpThreadIndex; _acceptor.async_accept(*socket, [this, socket, threadIndex](boost::system::error_code error) { if (!error) |
