Ejemplo n.º 1
0
        public WeenieError StopInterpretedMotion(uint motion, MovementParameters movementParams)
        {
            if (PhysicsObj == null)
            {
                return(WeenieError.NoPhysicsObject);
            }

            var result = WeenieError.None;

            if (contact_allows_move(motion))
            {
                if (StandingLongJump && (motion == (uint)MotionCommand.WalkForward || motion == (uint)MotionCommand.RunForward || motion == (uint)MotionCommand.SideStepRight))
                {
                    if (movementParams.ModifyInterpretedState)
                    {
                        InterpretedState.RemoveMotion(motion);
                    }
                }
                else
                {
                    result = PhysicsObj.StopInterpretedMotion(motion, movementParams);

                    if (result == WeenieError.None)
                    {
                        add_to_queue(movementParams.ContextID, (uint)MotionCommand.Ready, WeenieError.None);

                        if (movementParams.ModifyInterpretedState)
                        {
                            InterpretedState.RemoveMotion(motion);
                        }
                    }
                }
            }
            else
            {
                if (movementParams.ModifyInterpretedState)
                {
                    InterpretedState.RemoveMotion(motion);
                }
            }

            if (PhysicsObj.CurCell == null)
            {
                PhysicsObj.RemoveLinkAnimations();
            }

            return(result);
        }
Ejemplo n.º 2
0
        public Sequence StopInterpretedMotion(uint motion, MovementParameters movementParams)
        {
            if (PhysicsObj == null)
            {
                return(new Sequence(8));
            }

            var sequence = new Sequence();

            if (contact_allows_move(motion))
            {
                if (StandingLongJump && (motion == 0x45000005 || motion == 0x44000007 || motion == 0x6500000F))
                {
                    if (movementParams.ModifyInterpretedState)
                    {
                        InterpretedState.RemoveMotion(motion);
                    }
                }
                else
                {
                    sequence = PhysicsObj.StopInterpretedMotion(motion, movementParams);

                    if (sequence == null)
                    {
                        add_to_queue(movementParams.ContextID, 0x41000003, 0);

                        if (movementParams.ModifyInterpretedState)
                        {
                            InterpretedState.RemoveMotion(motion);
                        }
                    }
                }
            }
            else
            {
                if (movementParams.ModifyInterpretedState)
                {
                    InterpretedState.RemoveMotion(motion);
                }
            }

            if (PhysicsObj.CurCell == null)
            {
                PhysicsObj.RemoveLinkAnimations();
            }

            return(sequence);
        }