Core/Players: Fixed ExploredZones size and PLAYER_EXPLORED_ZONES_SIZE desync

Port From (https://github.com/TrinityCore/TrinityCore/commit/cb99b08b86f8773563276bf16ccc2210003b056b)
This commit is contained in:
hondacrx
2022-07-18 22:01:10 -04:00
parent cee989c731
commit 31d207c2ab
7 changed files with 23 additions and 17 deletions
+4 -4
View File
@@ -765,14 +765,14 @@ namespace Game.Chat
return false;
}
uint offset = (uint)area.AreaBit / 64;
uint offset = (uint)(area.AreaBit / ActivePlayerData.ExploredZonesBits);
if (offset >= PlayerConst.ExploredZonesSize)
{
handler.SendSysMessage(CypherStrings.BadValue);
return false;
}
uint val = (1u << (area.AreaBit % 64));
uint val = 1u << (area.AreaBit % ActivePlayerData.ExploredZonesBits);
playerTarget.RemoveExploredZones(offset, val);
handler.SendSysMessage(CypherStrings.UnexploreArea);
@@ -1750,14 +1750,14 @@ namespace Game.Chat
return false;
}
uint offset = (uint)area.AreaBit / 64;
uint offset = (uint)(area.AreaBit / ActivePlayerData.ExploredZonesBits);
if (offset >= PlayerConst.ExploredZonesSize)
{
handler.SendSysMessage(CypherStrings.BadValue);
return false;
}
ulong val = 1ul << (area.AreaBit % 64);
ulong val = 1ul << (area.AreaBit % ActivePlayerData.ExploredZonesBits);
playerTarget.AddExploredZones(offset, val);
handler.SendSysMessage(CypherStrings.ExploreArea);