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:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user