Core/DataStores: Removed hardcoded cap for battlepet species
Port From (https://github.com/TrinityCore/TrinityCore/commit/b636212392d547bc32e530cdd93a498622aca86d)
This commit is contained in:
@@ -49,7 +49,6 @@ namespace Framework.Constants
|
||||
/// <summary>
|
||||
/// BattlePets Const
|
||||
/// </summary>
|
||||
public const int MaxBattlePetSpeciesId = 3159;
|
||||
public const int DefaultMaxBattlePetsPerSpecies = 3;
|
||||
public const int BattlePetCageItemId = 82800;
|
||||
public const int SpellVisualUncagePet = 222;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Game
|
||||
}
|
||||
|
||||
auctionHouse.BuildListBuckets(listBucketsResult, _player, browseQuery.Name, browseQuery.MinLevel, browseQuery.MaxLevel, browseQuery.Filters, classFilters,
|
||||
browseQuery.KnownPets, browseQuery.KnownPets.Count, (byte)browseQuery.MaxPetLevel, browseQuery.Offset, browseQuery.Sorts, browseQuery.Sorts.Count);
|
||||
browseQuery.KnownPets, browseQuery.KnownPets.Length, (byte)browseQuery.MaxPetLevel, browseQuery.Offset, browseQuery.Sorts, browseQuery.Sorts.Count);
|
||||
|
||||
listBucketsResult.BrowseMode = AuctionHouseBrowseMode.Search;
|
||||
listBucketsResult.DesiredDelay = (uint)throttle.DelayUntilNext.TotalSeconds;
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using System.Collections.Generic;
|
||||
using Framework.Dynamic;
|
||||
|
||||
namespace Game.Networking.Packets
|
||||
{
|
||||
@@ -29,7 +29,7 @@ namespace Game.Networking.Packets
|
||||
public byte MinLevel = 1;
|
||||
public byte MaxLevel = SharedConst.MaxLevel;
|
||||
public AuctionHouseFilterMask Filters;
|
||||
public Array<byte> KnownPets = new(SharedConst.MaxBattlePetSpeciesId / 8 + 1);
|
||||
public byte[] KnownPets;
|
||||
public sbyte MaxPetLevel;
|
||||
public AddOnInfo? TaintedBy;
|
||||
public string Name;
|
||||
@@ -47,6 +47,12 @@ namespace Game.Networking.Packets
|
||||
Filters = (AuctionHouseFilterMask)_worldPacket.ReadUInt32();
|
||||
uint knownPetSize = _worldPacket.ReadUInt32();
|
||||
MaxPetLevel = _worldPacket.ReadInt8();
|
||||
|
||||
int sizeLimit = CliDB.BattlePetSpeciesStorage.Count / 8 +1;
|
||||
if (knownPetSize >= sizeLimit)
|
||||
throw new System.Exception($"Attempted to read more array elements from packet {knownPetSize} than allowed {sizeLimit}");
|
||||
|
||||
KnownPets = new byte[knownPetSize];
|
||||
for (var i = 0; i < knownPetSize; ++i)
|
||||
KnownPets[i] = _worldPacket.ReadUInt8();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user