Stack components are now entirely logicless.
- GetState is handled in SharedStackSystem - Adds friend attributes to the stack components
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Content.Shared.Stacks
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SharedStackComponent, ComponentGetState>(OnStackGetState);
|
||||
SubscribeLocalEvent<SharedStackComponent, ComponentHandleState>(OnStackHandleState);
|
||||
SubscribeLocalEvent<SharedStackComponent, ComponentStartup>(OnStackStarted);
|
||||
SubscribeLocalEvent<SharedStackComponent, ExaminedEvent>(OnStackExamined);
|
||||
@@ -62,6 +63,11 @@ namespace Content.Shared.Stacks
|
||||
RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count));
|
||||
}
|
||||
|
||||
private void OnStackGetState(EntityUid uid, SharedStackComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new StackComponentState(component.Count, component.MaxCount);
|
||||
}
|
||||
|
||||
private void OnStackHandleState(EntityUid uid, SharedStackComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not StackComponentState cast)
|
||||
|
||||
Reference in New Issue
Block a user