Update trivial components to use auto comp states (#20539)

This commit is contained in:
DrSmugleaf
2023-09-28 16:20:29 -07:00
committed by GitHub
parent 14cfe44ece
commit a44fa86b68
158 changed files with 806 additions and 2866 deletions

View File

@@ -5,8 +5,6 @@ using Content.Shared.Interaction;
using Content.Shared.Inventory.Events;
using Content.Shared.Radiation.Components;
using Content.Shared.Radiation.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Server.GameObjects;
using Robust.Server.Player;
@@ -32,7 +30,6 @@ public sealed class GeigerSystem : SharedGeigerSystem
SubscribeLocalEvent<GeigerComponent, GotUnequippedHandEvent>(OnUnequippedHand);
SubscribeLocalEvent<RadiationSystemUpdatedEvent>(OnUpdate);
SubscribeLocalEvent<GeigerComponent, ComponentGetState>(OnGetState);
}
private void OnActivate(EntityUid uid, GeigerComponent component, ActivateInWorldEvent args)
@@ -86,17 +83,6 @@ public sealed class GeigerSystem : SharedGeigerSystem
}
}
private void OnGetState(EntityUid uid, GeigerComponent component, ref ComponentGetState args)
{
args.State = new GeigerComponentState
{
CurrentRadiation = component.CurrentRadiation,
DangerLevel = component.DangerLevel,
IsEnabled = component.IsEnabled,
User = GetNetEntity(component.User)
};
}
private void SetCurrentRadiation(EntityUid uid, GeigerComponent component, float rads)
{
// check that it's approx equal