Add pulling taking up a hand (#2405)
* Add pulling taking up a hand * Revert unnecessary refactor
This commit is contained in:
11
Content.Shared/Physics/Pull/PullAttemptMessage.cs
Normal file
11
Content.Shared/Physics/Pull/PullAttemptMessage.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
|
||||
namespace Content.Shared.Physics.Pull
|
||||
{
|
||||
public class PullAttemptMessage : PullMessage
|
||||
{
|
||||
public PullAttemptMessage(IPhysicsComponent puller, IPhysicsComponent pulled) : base(puller, pulled) { }
|
||||
|
||||
public bool Cancelled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -100,6 +100,22 @@ namespace Content.Shared.Physics.Pull
|
||||
return false;
|
||||
}
|
||||
|
||||
var pullAttempt = new PullAttemptMessage(puller, ControlledComponent);
|
||||
|
||||
puller.Owner.SendMessage(null, pullAttempt);
|
||||
|
||||
if (pullAttempt.Cancelled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ControlledComponent.Owner.SendMessage(null, pullAttempt);
|
||||
|
||||
if (pullAttempt.Cancelled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_puller = puller;
|
||||
|
||||
var message = new PullStartedMessage(this, _puller, ControlledComponent);
|
||||
|
||||
Reference in New Issue
Block a user