Skip to content

Commit

Permalink
Made the InitialPackets optional.
Browse files Browse the repository at this point in the history
Fixed the PACKET_ZC_USE_SKILL_0x011a struct size.
  • Loading branch information
Tokeiburu committed Mar 4, 2024
1 parent 6eee5a9 commit e0708dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RrfParser/Packet/PacketParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public class PacketParser {
mobOutput.AppendLine("\tADelay (approximation): " + mobData.ADelay);
mobOutput.AppendLine("\tHP: " + mobData.HP);

if (Data.MobDrops.ContainsKey(mobData.View)) {
if (Data.MobDrops.ContainsKey(mobData.View) && Data.MobDead.ContainsKey(mobData.View)) {
int deaths = Data.MobDead[mobData.View];
Dictionary<int, double> rates = new Dictionary<int, double>();
Dictionary<int, double> rates2 = new Dictionary<int, double>();
Expand Down
2 changes: 1 addition & 1 deletion RrfParser/Packet/PacketStructures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public struct PACKET_ZC_USE_SKILL_0x09cb {
public struct PACKET_ZC_USE_SKILL_0x011a {
public Int16 PacketType;
public UInt16 SKID;
public Int32 level;
public UInt16 level;
public UInt32 targetAID;
public UInt32 srcAID;
public byte result;
Expand Down
6 changes: 5 additions & 1 deletion RrfParser/Replay/ReadPackets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public class ReadPackets {

List<Chunk> chunks = new List<Chunk>();

chunks.AddRange(mainContainers.First(p => p.ContainerType == ContainerType.InitialPackets).Data);
var initialPacket = mainContainers.FirstOrDefault(p => p.ContainerType == ContainerType.InitialPackets);

if (initialPacket != null)
chunks.AddRange(initialPacket.Data);

chunks.AddRange(mainContainers.First(p => p.ContainerType == ContainerType.PacketStream).Data);
chunks = chunks.Where(p => p.Length > 0).ToList();

Expand Down

0 comments on commit e0708dc

Please sign in to comment.