Core/BattlePets: Store declined names

Port From (https://github.com/TrinityCore/TrinityCore/commit/82b3a409db4dfe689c84234f3ae427369325bf0b)
This commit is contained in:
hondacrx
2021-10-16 17:40:34 -04:00
parent a9bdba8196
commit 86cc00ff57
6 changed files with 111 additions and 13 deletions
@@ -125,7 +125,7 @@ namespace Game.Networking.Packets
if (_worldPacket.HasBit())
{
Declined = new DeclinedName();
DeclinedName.Set(new DeclinedName());
byte[] declinedNameLengths = new byte[SharedConst.MaxDeclinedNameCases];
@@ -133,7 +133,7 @@ namespace Game.Networking.Packets
declinedNameLengths[i] = _worldPacket.ReadBits<byte>(7);
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; ++i)
Declined.name[i] = _worldPacket.ReadString(declinedNameLengths[i]);
DeclinedName.Value.name[i] = _worldPacket.ReadString(declinedNameLengths[i]);
}
Name = _worldPacket.ReadString(nameLength);
@@ -141,7 +141,7 @@ namespace Game.Networking.Packets
public ObjectGuid PetGuid;
public string Name;
public DeclinedName Declined;
public Optional<DeclinedName> DeclinedName;
}
class BattlePetDeletePet : ClientPacket