Core/Players: Cleaned some old updatefield definitions and updated values for completed quests size
Port From (https://github.com/TrinityCore/TrinityCore/commit/26d757946f4e26397930e2d8733c0b1c7f76d0a6)
This commit is contained in:
@@ -3471,6 +3471,8 @@ namespace Game.Entities
|
||||
{
|
||||
public static int ExploredZonesSize;
|
||||
public static int ExploredZonesBits;
|
||||
public static int QuestCompletedBitsSize;
|
||||
public static int QuestCompletedBitsPerBlock;
|
||||
|
||||
public UpdateField<bool> BackpackAutoSortDisabled = new(0, 1);
|
||||
public UpdateField<bool> BankAutoSortDisabled = new(0, 2);
|
||||
@@ -3602,6 +3604,9 @@ namespace Game.Entities
|
||||
{
|
||||
ExploredZonesSize = ExploredZones.GetSize();
|
||||
ExploredZonesBits = sizeof(ulong) * 8;
|
||||
|
||||
QuestCompletedBitsSize = QuestCompleted.GetSize();
|
||||
QuestCompletedBitsPerBlock = sizeof(ulong) * 8;
|
||||
}
|
||||
|
||||
public void WriteCreate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Player owner, Player receiver)
|
||||
|
||||
@@ -2218,11 +2218,11 @@ namespace Game.Entities
|
||||
if (questBit == 0)
|
||||
return;
|
||||
|
||||
uint fieldOffset = (questBit - 1) >> 6;
|
||||
uint fieldOffset = (questBit - 1) >> ActivePlayerData.QuestCompletedBitsPerBlock;
|
||||
if (fieldOffset >= PlayerConst.QuestsCompletedBitsSize)
|
||||
return;
|
||||
|
||||
ulong flag = 1ul << (((int)questBit - 1) & 63);
|
||||
ulong flag = 1ul << (((int)questBit - 1) % ActivePlayerData.QuestCompletedBitsPerBlock);
|
||||
if (completed)
|
||||
SetUpdateFieldFlagValue(ref m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.QuestCompleted, (int)fieldOffset), flag);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user