// -- Core attempted actions --

        public bool TryStopPull(SharedPullableComponent pullable, EntityUid?user = null)
        {
            if (!pullable.BeingPulled)
            {
                return(false);
            }

            var msg = new StopPullingEvent(user);

            RaiseLocalEvent(pullable.Owner, msg, true);

            if (msg.Cancelled)
            {
                return(false);
            }

            // Stop pulling confirmed!

            if (TryComp <PhysicsComponent>(pullable.Owner, out var pullablePhysics))
            {
                pullablePhysics.FixedRotation = pullable.PrevFixedRotation;
            }

            _pullSm.ForceRelationship(null, pullable);
            return(true);
        }
示例#2
0
        // -- Core attempted actions --

        public bool TryStopPull(SharedPullableComponent pullable, EntityUid?user = null)
        {
            if (!pullable.BeingPulled)
            {
                return(false);
            }

            var msg = new StopPullingEvent(user);

            RaiseLocalEvent(pullable.Owner, msg);

            if (msg.Cancelled)
            {
                return(false);
            }

            _pullSm.ForceRelationship(null, pullable);
            return(true);
        }
示例#3
0
        private void HandleStopPull(EntityUid uid, SharedCuffableComponent component, StopPullingEvent args)
        {
            if (args.User == null || !EntityManager.EntityExists(args.User.Value))
            {
                return;
            }

            if (args.User.Value == component.Owner && !component.CanStillInteract)
            {
                args.Cancel();
            }
        }