@@ -185,14 +185,8 @@ bool Group::Create(Player* leader)
185185 stmt->setUInt8 (index++, uint8 (m_lootMethod));
186186 stmt->setUInt64 (index++, m_looterGuid.GetCounter ());
187187 stmt->setUInt8 (index++, uint8 (m_lootThreshold));
188- stmt->setBinary (index++, m_targetIcons[0 ].GetRawValue ());
189- stmt->setBinary (index++, m_targetIcons[1 ].GetRawValue ());
190- stmt->setBinary (index++, m_targetIcons[2 ].GetRawValue ());
191- stmt->setBinary (index++, m_targetIcons[3 ].GetRawValue ());
192- stmt->setBinary (index++, m_targetIcons[4 ].GetRawValue ());
193- stmt->setBinary (index++, m_targetIcons[5 ].GetRawValue ());
194- stmt->setBinary (index++, m_targetIcons[6 ].GetRawValue ());
195- stmt->setBinary (index++, m_targetIcons[7 ].GetRawValue ());
188+ for (uint8 i = 0 ; i < TARGET_ICONS_COUNT; ++i)
189+ stmt->setBinary (index++, m_targetIcons[i].GetRawValue ());
196190 stmt->setUInt16 (index++, m_groupFlags);
197191 stmt->setUInt32 (index++, uint8 (m_dungeonDifficulty));
198192 stmt->setUInt32 (index++, uint8 (m_raidDifficulty));
@@ -232,7 +226,8 @@ void Group::LoadGroupFromDB(Field* fields)
232226 m_lootThreshold = ItemQualities (fields[3 ].GetUInt8 ());
233227
234228 for (uint8 i = 0 ; i < TARGET_ICONS_COUNT; ++i)
235- m_targetIcons[i].SetRawValue (fields[4 + i].GetBinary ());
229+ if (std::span<uint8 const > rawGuidBytes = fields[4 + i].GetBinaryView (); rawGuidBytes.size () == ObjectGuid::BytesSize)
230+ m_targetIcons[i].SetRawValue (rawGuidBytes);
236231
237232 m_groupFlags = GroupFlags (fields[12 ].GetUInt16 ());
238233 if (m_groupFlags & GROUP_FLAG_RAID)
0 commit comments