Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -7,7 +7,6 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Storage;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Buckle;
|
||||
|
||||
@@ -19,9 +18,6 @@ public abstract partial class SharedBuckleSystem
|
||||
SubscribeLocalEvent<StrapComponent, ComponentShutdown>(OnStrapShutdown);
|
||||
SubscribeLocalEvent<StrapComponent, ComponentRemove>((_, c, _) => StrapRemoveAll(c));
|
||||
|
||||
SubscribeLocalEvent<StrapComponent, ComponentGetState>(OnStrapGetState);
|
||||
SubscribeLocalEvent<StrapComponent, ComponentHandleState>(OnStrapHandleState);
|
||||
|
||||
SubscribeLocalEvent<StrapComponent, EntInsertedIntoContainerMessage>(OnStrapEntModifiedFromContainer);
|
||||
SubscribeLocalEvent<StrapComponent, EntRemovedFromContainerMessage>(OnStrapEntModifiedFromContainer);
|
||||
SubscribeLocalEvent<StrapComponent, GetVerbsEvent<InteractionVerb>>(AddStrapVerbs);
|
||||
@@ -50,24 +46,6 @@ public abstract partial class SharedBuckleSystem
|
||||
StrapRemoveAll(component);
|
||||
}
|
||||
|
||||
private void OnStrapGetState(EntityUid uid, StrapComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new StrapComponentState(component.Position, component.BuckleOffset, GetNetEntitySet(component.BuckledEntities), component.MaxBuckleDistance, component.OccupiedSize);
|
||||
}
|
||||
|
||||
private void OnStrapHandleState(EntityUid uid, StrapComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not StrapComponentState state)
|
||||
return;
|
||||
|
||||
component.Position = state.Position;
|
||||
component.BuckleOffsetUnclamped = state.BuckleOffsetClamped;
|
||||
component.BuckledEntities.Clear();
|
||||
component.BuckledEntities.UnionWith(EnsureEntitySet<StrapComponent>(state.BuckledEntities, uid));
|
||||
component.MaxBuckleDistance = state.MaxBuckleDistance;
|
||||
component.OccupiedSize = state.OccupiedSize;
|
||||
}
|
||||
|
||||
private void OnStrapEntModifiedFromContainer(EntityUid uid, StrapComponent component, ContainerModifiedMessage message)
|
||||
{
|
||||
if (_gameTiming.ApplyingState)
|
||||
|
||||
Reference in New Issue
Block a user