Make Health Analyzer scan range nullable and adjust admin PDA (#36347)
* Modify .cs and admin pda * enhance comment
This commit is contained in:
@@ -39,10 +39,10 @@ public sealed partial class HealthAnalyzerComponent : Component
|
|||||||
public EntityUid? ScannedEntity;
|
public EntityUid? ScannedEntity;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum range in tiles at which the analyzer can receive continuous updates
|
/// The maximum range in tiles at which the analyzer can receive continuous updates, a value of null will be infinite range
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField]
|
||||||
public float MaxScanRange = 2.5f;
|
public float? MaxScanRange = 2.5f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sound played on scanning begin
|
/// Sound played on scanning begin
|
||||||
|
|||||||
@@ -63,8 +63,9 @@ public sealed class HealthAnalyzerSystem : EntitySystem
|
|||||||
component.NextUpdate = _timing.CurTime + component.UpdateInterval;
|
component.NextUpdate = _timing.CurTime + component.UpdateInterval;
|
||||||
|
|
||||||
//Get distance between health analyzer and the scanned entity
|
//Get distance between health analyzer and the scanned entity
|
||||||
|
//null is infinite range
|
||||||
var patientCoordinates = Transform(patient).Coordinates;
|
var patientCoordinates = Transform(patient).Coordinates;
|
||||||
if (!_transformSystem.InRange(patientCoordinates, transform.Coordinates, component.MaxScanRange))
|
if (component.MaxScanRange != null && !_transformSystem.InRange(patientCoordinates, transform.Coordinates, component.MaxScanRange.Value))
|
||||||
{
|
{
|
||||||
//Range too far, disable updates
|
//Range too far, disable updates
|
||||||
StopAnalyzingEntity((uid, component), patient);
|
StopAnalyzingEntity((uid, component), patient);
|
||||||
|
|||||||
@@ -949,6 +949,7 @@
|
|||||||
- type: Pda
|
- type: Pda
|
||||||
id: UniversalIDCard
|
id: UniversalIDCard
|
||||||
- type: HealthAnalyzer
|
- type: HealthAnalyzer
|
||||||
|
maxScanRange: null
|
||||||
scanDelay: 0
|
scanDelay: 0
|
||||||
silent: true
|
silent: true
|
||||||
- type: CartridgeLoader
|
- type: CartridgeLoader
|
||||||
|
|||||||
Reference in New Issue
Block a user