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:
@@ -614,22 +614,12 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
Logger.WarningS("VitalComponentMissing", $"Disposal unit {Owner.Uid} is missing an anchorable component");
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out IPhysicsComponent? physics))
|
||||
{
|
||||
physics.AnchoredChanged += UpdateVisualState;
|
||||
}
|
||||
|
||||
UpdateTargetList();
|
||||
UpdateVisualState();
|
||||
}
|
||||
|
||||
public override void OnRemove()
|
||||
{
|
||||
if (Owner.TryGetComponent(out IPhysicsComponent? physics))
|
||||
{
|
||||
physics.AnchoredChanged -= UpdateVisualState;
|
||||
}
|
||||
|
||||
if (_container != null)
|
||||
{
|
||||
foreach (var entity in _container.ContainedEntities.ToArray())
|
||||
@@ -671,6 +661,10 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
Remove(msg.Entity);
|
||||
break;
|
||||
|
||||
case AnchoredChangedMessage:
|
||||
UpdateVisualState();
|
||||
break;
|
||||
|
||||
case PowerChangedMessage powerChanged:
|
||||
PowerStateChanged(powerChanged);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user