Really, what is the difference between doing:
And
Whats the pros and cons of each one?
Code:
*(ushort*)PTR = (ushort)Buffer.Length;
*((ushort*)(PTR + 2)) = 2030;
*((uint*)(PTR + 4)) = npc.StaticID;
*((ushort*)(PTR + 8)) = (ushort)npc.Cords.Position.X;
*((ushort*)(PTR + 10)) = (ushort)npc.Cords.Position.Y;
*((ushort*)(PTR + 12)) = (ushort)(npc.StaticID + (byte)npc.Direction);
*((ushort*)(PTR + 14)) = npc.Interaction;
Code:
PacketBuilder Packet = new PacketBuilder(new byte[20]);
Packet.WriteUInt16(Packet.Packet.Length);
Packet.WriteUInt16(2030);
Packet.WriteUInt32((uint)Type);
Packet.WriteUInt16(X);
Packet.WriteUInt16(Y);
Packet.WriteUInt16(SubType);
Packet.WriteUInt16(Dir);
Packet.WriteUInt32((uint)Flag);