Get rid of CuffSystem, make CuffableComponent update its hand count properly (#1927)

* Merge branch 'master' of https://github.com/space-wizards/space-station-14 into cuff-fix

* yml

* event bus
This commit is contained in:
nuke
2020-08-27 10:33:10 -04:00
committed by GitHub
parent fc6ec5a7b9
commit 388e717a53
4 changed files with 29 additions and 28 deletions

View File

@@ -29,6 +29,7 @@ using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Players;
using Robust.Shared.ViewVariables;
using Content.Server.GameObjects.Components.ActionBlocking;
namespace Content.Server.GameObjects.Components.GUI
{
@@ -444,6 +445,7 @@ namespace Content.Server.GameObjects.Components.GUI
ActiveHand ??= name;
OnItemChanged?.Invoke();
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new HandCountChangedEvent(Owner));
Dirty();
}
@@ -466,6 +468,7 @@ namespace Content.Server.GameObjects.Components.GUI
}
OnItemChanged?.Invoke();
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new HandCountChangedEvent(Owner));
Dirty();
}
@@ -791,4 +794,14 @@ namespace Content.Server.GameObjects.Components.GUI
return new SharedHand(index, Name, Entity?.Uid, location);
}
}
public class HandCountChangedEvent : EntitySystemMessage
{
public HandCountChangedEvent(IEntity sender)
{
Sender = sender;
}
public IEntity Sender { get; }
}
}