Horrendously makes PowerDevice connect to the closest Provider (#326)
* Somewhat decently makes PowerDevice connect to the closest Provider * Fix NullRef on server shutdown * Fix null reference * piss * revert bad fix
This commit is contained in:
committed by
Pieter-Jan Briers
parent
36078382e4
commit
0815050b2a
@@ -269,5 +269,13 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
device.Owner, Owner);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether the device can be serviced by this provider.
|
||||
/// </summary>
|
||||
public bool CanServiceDevice(PowerDeviceComponent device)
|
||||
{
|
||||
return (device.Owner.Transform.WorldPosition - Owner.Transform.WorldPosition).LengthSquared <= _range;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user