The disposals pushing and pulling update (#1875)
* Add collision to disposal unit and pipes Make disposal unit and pipes pullable Implement proper handling of collisions in disposals * Implement IsExiting Move DisposalSystem to shared * Change SharedDisosalUnitComponent to call manager.ContainsEntity directly * Update saltern.yml Co-authored-by: Julian Giebel <j.giebel@netrocks.info>
This commit is contained in:
@@ -29,6 +29,7 @@ using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Timing;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using Timer = Robust.Shared.Timers.Timer;
|
||||
@@ -36,6 +37,7 @@ using Timer = Robust.Shared.Timers.Timer;
|
||||
namespace Content.Server.GameObjects.Components.Disposal
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedDisposalUnitComponent))]
|
||||
[ComponentReference(typeof(IInteractUsing))]
|
||||
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IInteractUsing, IDragDropOn
|
||||
{
|
||||
@@ -429,8 +431,9 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
: LightState.Ready);
|
||||
}
|
||||
|
||||
public void Update(float frameTime)
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
if (!Powered)
|
||||
{
|
||||
return;
|
||||
@@ -512,10 +515,15 @@ namespace Content.Server.GameObjects.Components.Disposal
|
||||
{
|
||||
base.Startup();
|
||||
|
||||
Owner.EnsureComponent<AnchorableComponent>();
|
||||
if(!Owner.HasComponent<AnchorableComponent>())
|
||||
{
|
||||
Logger.WarningS("VitalComponentMissing", $"Disposal unit {Owner.Uid} is missing an anchorable component");
|
||||
}
|
||||
|
||||
var collidable = Owner.EnsureComponent<CollidableComponent>();
|
||||
collidable.AnchoredChanged += UpdateVisualState;
|
||||
if (Owner.TryGetComponent(out CollidableComponent? collidable))
|
||||
{
|
||||
collidable.AnchoredChanged += UpdateVisualState;
|
||||
}
|
||||
|
||||
if (Owner.TryGetComponent(out PowerReceiverComponent? receiver))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user