diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-01-03 13:47:24 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2025-01-03 18:05:09 +0100 |
commit | cfc260e68192dc52c72628447ffbedbd6e4a7e91 (patch) | |
tree | 2260772a22075fbbe5ff7664060b440b288d655d /src/server/game/Groups/Group.cpp | |
parent | 5da556b9a4094da461a4c88249fb0359172d72d2 (diff) |
Core/Objects: Use span/array instead of vector for raw ObjectGuid manipulations
(cherry picked from commit c72de2fbbcdf5b416d78b9e455aced43517033a8)
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r-- | src/server/game/Groups/Group.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 90c895d11a3..12d11a882f3 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -188,14 +188,8 @@ bool Group::Create(Player* leader) stmt->setUInt8(index++, uint8(m_lootMethod)); stmt->setUInt64(index++, m_looterGuid.GetCounter()); stmt->setUInt8(index++, uint8(m_lootThreshold)); - stmt->setBinary(index++, m_targetIcons[0].GetRawValue()); - stmt->setBinary(index++, m_targetIcons[1].GetRawValue()); - stmt->setBinary(index++, m_targetIcons[2].GetRawValue()); - stmt->setBinary(index++, m_targetIcons[3].GetRawValue()); - stmt->setBinary(index++, m_targetIcons[4].GetRawValue()); - stmt->setBinary(index++, m_targetIcons[5].GetRawValue()); - stmt->setBinary(index++, m_targetIcons[6].GetRawValue()); - stmt->setBinary(index++, m_targetIcons[7].GetRawValue()); + for (uint8 i = 0; i < TARGET_ICONS_COUNT; ++i) + stmt->setBinary(index++, m_targetIcons[i].GetRawValue()); stmt->setUInt16(index++, m_groupFlags); stmt->setUInt32(index++, uint8(m_dungeonDifficulty)); stmt->setUInt32(index++, uint8(m_raidDifficulty)); @@ -234,7 +228,8 @@ void Group::LoadGroupFromDB(Field* fields) m_lootThreshold = ItemQualities(fields[3].GetUInt8()); for (uint8 i = 0; i < TARGET_ICONS_COUNT; ++i) - m_targetIcons[i].SetRawValue(fields[4 + i].GetBinary()); + if (std::span<uint8 const> rawGuidBytes = fields[4 + i].GetBinaryView(); rawGuidBytes.size() == ObjectGuid::BytesSize) + m_targetIcons[i].SetRawValue(rawGuidBytes); m_groupFlags = GroupFlags(fields[12].GetUInt16()); if (m_groupFlags & GROUP_FLAG_RAID) |