Team Crash Bug

09/29/2011 20:38 ryuchetval#1
Hello everybody...
So.....
I am using 5165 LOTF
To explain the problem:
When you have a dead player in the team and another player joins the team that player crashes (client close).

I think it all comes from the packet...

This is my PlayerJoin packet

Code:
        public static COPacket PlayerJoinsTeam(Game.Character C)
        {
            byte[] Packet = new byte[8 + 36];
            COPacket P = new COPacket(Packet);

            P.WriteInt16((ushort)(Packet.Length - 8));
            P.WriteInt16((ushort)0x402);
            P.WriteByte(0);
            P.WriteByte(1);
            P.WriteByte(1);
            P.WriteByte(1);
            P.WriteString((C.Name + C.MyClient.AuthInfo.Status));
            P.Move(16 - (C.Name + C.MyClient.AuthInfo.Status).Length);
            P.WriteInt32(C.EntityID);
           [B][COLOR="Red"]P.WriteInt32(uint.Parse(C.Avatar.ToString() + C.Body.ToString()));[/COLOR]

          [COLOR="DarkOrange"] // P.WriteInt32((uint)(C.TransID * 10000000 + C.Avatar * 10000 +  C.Body));[/COLOR][/B]
            P.WriteInt16((ushort)C.CurHP);
            P.WriteInt16((ushort)C.MaxHP);

            return P;
        }
The line in red doesn't work...it still crashes...(it's the line that came from the source when I got it)

The line in orange comes from the uint Mesh (which is returned when player is alive as we don't need the avatar when the player is dead...)

I am not sure if this is the problem but I think it is...
So what should go in that line....according to Korvacs packet list it avatar should go into that line...
If anyone can help me thanks ;)