Gun auto state handlers (#15186)
* battery auto state * basic entity autostate * ballistic autostate * flyby * cartridge ammo * gun * Revert "battery auto state" This reverts commit 35b7d62f303fddb0edd9eb7a922e3c26b7a5f7fb. * silly
This commit is contained in:
@@ -20,8 +20,6 @@ public abstract class SharedFlyBySoundSystem : EntitySystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<FlyBySoundComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<FlyBySoundComponent, ComponentHandleState>(OnHandleState);
|
||||
SubscribeLocalEvent<FlyBySoundComponent, ComponentStartup>(OnStartup);
|
||||
SubscribeLocalEvent<FlyBySoundComponent, ComponentShutdown>(OnShutdown);
|
||||
}
|
||||
@@ -46,28 +44,4 @@ public abstract class SharedFlyBySoundSystem : EntitySystem
|
||||
|
||||
_fixtures.DestroyFixture(uid, FlyByFixture, body: body);
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, FlyBySoundComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not FlyBySoundComponentState state) return;
|
||||
|
||||
component.Sound = state.Sound;
|
||||
component.Range = state.Range;
|
||||
}
|
||||
|
||||
private void OnGetState(EntityUid uid, FlyBySoundComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new FlyBySoundComponentState()
|
||||
{
|
||||
Sound = component.Sound,
|
||||
Range = component.Range,
|
||||
};
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
private sealed class FlyBySoundComponentState : ComponentState
|
||||
{
|
||||
public SoundSpecifier Sound = default!;
|
||||
public float Range;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user