Updates various systems to the new InputCommandHandler delegate signature, implementing the new handled return value.
Modifies the construction system to use the newer InputHandler system, instead of the older ClickComponent system. Updates the engine submodule.
This commit is contained in:
@@ -371,9 +371,19 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The different methods that a <see cref="PowerDeviceComponent"/> can use to connect to a power network.
|
||||
/// </summary>
|
||||
public enum DrawTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// This device cannot be connected to a power network.
|
||||
/// </summary>
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// This device can connect to a <see cref=""/>
|
||||
/// </summary>
|
||||
Node = 1,
|
||||
Provider = 2,
|
||||
Both = 3,
|
||||
|
||||
@@ -6,6 +6,7 @@ using Robust.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Power
|
||||
@@ -275,6 +276,10 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
/// </summary>
|
||||
public bool CanServiceDevice(PowerDeviceComponent device)
|
||||
{
|
||||
// Stops an APC from trying to connect to itself
|
||||
if (this == device)
|
||||
return false;
|
||||
|
||||
return (device.Owner.Transform.WorldPosition - Owner.Transform.WorldPosition).LengthSquared <= _range;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user