mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Player: Fix equipment set GUID handling (#21646)
Setting max GUID at server load was not taking transmog outfits into consideration. New equip sets were always stored in _equipmentSets[0], overwriting eachother
This commit is contained in:
@@ -26591,15 +26591,14 @@ void Player::SetEquipmentSet(EquipmentSetInfo::EquipmentSetData const& newEqSet)
|
||||
}
|
||||
}
|
||||
|
||||
EquipmentSetInfo& eqSlot = _equipmentSets[newEqSet.Guid];
|
||||
|
||||
EquipmentSetUpdateState oldState = eqSlot.State;
|
||||
uint64 setGuid = (newEqSet.Guid != 0) ? newEqSet.Guid : sObjectMgr->GenerateEquipmentSetGuid();
|
||||
|
||||
EquipmentSetInfo& eqSlot = _equipmentSets[setGuid];
|
||||
eqSlot.Data = newEqSet;
|
||||
|
||||
if (eqSlot.Data.Guid == 0)
|
||||
{
|
||||
eqSlot.Data.Guid = sObjectMgr->GenerateEquipmentSetGuid();
|
||||
eqSlot.Data.Guid = setGuid;
|
||||
|
||||
WorldPackets::EquipmentSet::EquipmentSetID data;
|
||||
data.GUID = eqSlot.Data.Guid;
|
||||
@@ -26608,7 +26607,7 @@ void Player::SetEquipmentSet(EquipmentSetInfo::EquipmentSetData const& newEqSet)
|
||||
SendDirectMessage(data.Write());
|
||||
}
|
||||
|
||||
eqSlot.State = oldState == EQUIPMENT_SET_NEW ? EQUIPMENT_SET_NEW : EQUIPMENT_SET_CHANGED;
|
||||
eqSlot.State = eqSlot.State == EQUIPMENT_SET_NEW ? EQUIPMENT_SET_NEW : EQUIPMENT_SET_CHANGED;
|
||||
}
|
||||
|
||||
void Player::_SaveEquipmentSets(SQLTransaction& trans)
|
||||
|
||||
@@ -6728,7 +6728,7 @@ void ObjectMgr::SetHighestGuids()
|
||||
if (result)
|
||||
sArenaTeamMgr->SetNextArenaTeamId((*result)[0].GetUInt32()+1);
|
||||
|
||||
result = CharacterDatabase.Query("SELECT MAX(setguid) FROM character_equipmentsets");
|
||||
result = CharacterDatabase.Query("SELECT MAX(maxguid) FROM ((SELECT MAX(setguid) AS maxguid FROM character_equipmentsets) UNION (SELECT MAX(setguid) AS maxguid FROM character_transmog_outfits)) allsets");
|
||||
if (result)
|
||||
_equipmentSetGuid = (*result)[0].GetUInt64()+1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user