Skip to content

Commit

Permalink
Fix some bugs due to recent additions and certain options (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife authored Oct 9, 2024
1 parent cc61891 commit 548db4a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion WowPacketParser/Parsing/Parsers/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3104,7 +3104,7 @@ public static void HandleDestroyObject(Packet packet)
update.Destroyed.Add(new DestroyedObject()
{
Guid = guid,
Text = packet.Writer.ToString()
Text = packet.Writer?.ToString() ?? ""
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ public static TK[] GetArray<T, TK>(this Dictionary<int, UpdateField> dict, T fir
for (var i = 0; i < count; i++)
{
UpdateField uf;
if (dict.TryGetValue(Enums.Version.UpdateFields.GetUpdateField(firstUpdateField) + i, out uf))
var updateField = Enums.Version.UpdateFields.GetUpdateField(firstUpdateField);
if (updateField == -1)
continue;
if (dict.TryGetValue(updateField + i, out uf))
{
switch (type)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ public static void HandleDestroyObject(Packet packet)
update.Destroyed.Add(new DestroyedObject()
{
Guid = destroyed,
Text = packet.Writer.ToString()
Text = packet.Writer?.ToString() ?? ""
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ public static void HandleDestroyObject(Packet packet)
update.Destroyed.Add(new DestroyedObject()
{
Guid = destroyed,
Text = packet.Writer.ToString()
Text = packet.Writer?.ToString() ?? ""
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ public static void HandleDestroyObject(Packet packet)
update.Destroyed.Add(new DestroyedObject()
{
Guid = destroyed,
Text = packet.Writer.ToString()
Text = packet.Writer?.ToString() ?? ""
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void HandleDestroyObject(Packet packet)
update.Destroyed.Add(new DestroyedObject()
{
Guid = destroyed,
Text = packet.Writer.ToString()
Text = packet.Writer?.ToString() ?? ""
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void HandleDestroyObject(Packet packet)
update.Destroyed.Add(new DestroyedObject()
{
Guid = destroyed,
Text = packet.Writer.ToString()
Text = packet.Writer?.ToString() ?? ""
});
}

Expand Down

0 comments on commit 548db4a

Please sign in to comment.