public void Encode(Packet packet) { CharacterStat.Encode(packet); // Newer versions do not really use this #if USING_AVATARLOOK_ENCODE AvatarLook.Encode(packet); #else for (byte i = 1; i < Constants.EquipSlots.MaxSlotIndex; i++) { int itemid = AvatarLook.HairEquip[i]; if (itemid == 0) { continue; } packet.WriteByte(i); packet.WriteInt(itemid); } // Client checks for '!((byte)slot)', so this must be zero! packet.WriteByte(0); for (byte i = 1; i < Constants.EquipSlots.MaxSlotIndex; i++) { int itemid = AvatarLook.UnseenEquip[i]; if (itemid == 0) { continue; } packet.WriteByte(i); packet.WriteInt(itemid); } packet.WriteByte(0); #endif }