Fixed two crashes

This commit is contained in:
hondacrx
2021-04-21 19:54:20 -04:00
parent ba064327b0
commit 40826f78a2
6 changed files with 12 additions and 10 deletions
+3 -1
View File
@@ -2921,7 +2921,7 @@ namespace Game.Entities
public class AzeriteEmpoweredData
{
public Array<int> SelectedAzeritePowers = new(SharedConst.MaxAzeriteEmpoweredTier);
public int[] SelectedAzeritePowers = new int[SharedConst.MaxAzeriteEmpoweredTier];
}
class ItemAdditionalLoadInfo
@@ -2989,6 +2989,8 @@ namespace Game.Entities
info.AzeriteItem.KnowledgeLevel = azeriteItemResult.Read<uint>(3);
for (int i = 0; i < info.AzeriteItem.SelectedAzeriteEssences.Length; ++i)
{
info.AzeriteItem.SelectedAzeriteEssences[i] = new();
uint specializationId = azeriteItemResult.Read<uint>(4 + i * 4);
if (!CliDB.ChrSpecializationStorage.ContainsKey(specializationId))
continue;
+1 -1
View File
@@ -493,7 +493,7 @@ namespace Game.Entities
data.WriteBit(hasMovementScript);
if (hasUnk3)
data.WriteBit(0);
data.WriteBit(false);
data.FlushBits();
@@ -137,7 +137,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(Mapid);
_worldPacket.WriteUInt32(ShutdownTimer);
_worldPacket.WriteUInt32(StartTimer);
_worldPacket.WriteBit(ArenaFaction);
_worldPacket.WriteBit(ArenaFaction != 0);
_worldPacket.WriteBit(LeftEarly);
_worldPacket.FlushBits();
}
@@ -629,7 +629,7 @@ namespace Game.Networking.Packets
foreach (var pvpStat in Stats)
pvpStat.Write(data);
data.WriteBit(Faction);
data.WriteBit(Faction != 0);
data.WriteBit(IsInWorld);
data.WriteBit(Honor.HasValue);
data.WriteBit(PreMatchRating.HasValue);
@@ -63,7 +63,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(MaxLevel);
_worldPacket.WriteInt32(MapID);
_worldPacket.WriteUInt32(InstanceID);
_worldPacket.WriteBit(Index);
_worldPacket.WriteBit(Index != 0);
_worldPacket.FlushBits();
}