public MotionItem(MotionItem motionItem) { // copy constructor WorldObject = motionItem.WorldObject; MotionCommand = motionItem.MotionCommand; PackedSequence = motionItem.PackedSequence; ServerActionSequence = motionItem.ServerActionSequence; IsAutonomous = motionItem.IsAutonomous; Speed = motionItem.Speed; }
public static void Write(this BinaryWriter writer, MotionItem mc) { var sequence = mc.WorldObject.Sequences; writer.Write((ushort)mc.MotionCommand); // verified // should already be masked with 0x7FFF var nextSequence = sequence.GetNextSequence(SequenceType.Motion); if (mc.IsAutonomous) { nextSequence[1] |= 0x80; // if client-initiated motion, set upper bit } writer.Write(nextSequence); writer.Write(mc.Speed); }