Replaces AnchoredChanged C# event with ComponentMessage (#2905)
* Replaces AnchoredChanged C# event with ComponentMessage * Removes unneeded fields Co-authored-by: py01 <pyronetics01@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#nullable enable
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Content.Shared.GameObjects.Components.Disposal;
|
||||
@@ -231,10 +231,6 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
|
||||
Contents = ContainerManagerComponent.Ensure<Container>(Name, Owner);
|
||||
Owner.EnsureComponent<AnchorableComponent>();
|
||||
|
||||
var physics = Owner.EnsureComponent<PhysicsComponent>();
|
||||
|
||||
physics.AnchoredChanged += AnchoredChanged;
|
||||
}
|
||||
|
||||
protected override void Startup()
|
||||
@@ -254,9 +250,6 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
var physics = Owner.EnsureComponent<PhysicsComponent>();
|
||||
physics.AnchoredChanged -= AnchoredChanged;
|
||||
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
@@ -275,6 +268,10 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
_lastClang = _gameTiming.CurTime;
|
||||
EntitySystem.Get<AudioSystem>().PlayAtCoords(_clangSound, Owner.Transform.Coordinates);
|
||||
break;
|
||||
|
||||
case AnchoredChangedMessage:
|
||||
AnchoredChanged();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user