]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make Health Analyzer scan range nullable and adjust admin PDA (#36347)
authorMinemoder5000 <minemoder50000@gmail.com>
Sun, 6 Apr 2025 08:31:06 +0000 (02:31 -0600)
committerGitHub <noreply@github.com>
Sun, 6 Apr 2025 08:31:06 +0000 (10:31 +0200)
* Modify .cs and admin pda

* enhance comment

Content.Server/Medical/Components/HealthAnalyzerComponent.cs
Content.Server/Medical/HealthAnalyzerSystem.cs
Resources/Prototypes/Entities/Objects/Devices/pda.yml

index 34b7af0212dd878157f6e60b913e18b9326a002a..9c7ccd5330490a87f777db6f4d16a0e883ff1013 100644 (file)
@@ -39,10 +39,10 @@ public sealed partial class HealthAnalyzerComponent : Component
     public EntityUid? ScannedEntity;
 
     /// <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>
     [DataField]
-    public float MaxScanRange = 2.5f;
+    public float? MaxScanRange = 2.5f;
 
     /// <summary>
     /// Sound played on scanning begin
index 9f8ee92e3d741d1e5cf8bdea9d561ccd8a427626..f2235363ad860bc28a788861f0adab7bab0e47d3 100644 (file)
@@ -63,8 +63,9 @@ public sealed class HealthAnalyzerSystem : EntitySystem
             component.NextUpdate = _timing.CurTime + component.UpdateInterval;
 
             //Get distance between health analyzer and the scanned entity
+            //null is infinite range
             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
                 StopAnalyzingEntity((uid, component), patient);
index b5ec63577e3757ad3616b750ce335f076bd13fe1..d1ac45387f3934d0aeb44cd2484e7dc9fabaaf2c 100644 (file)
   - type: Pda
     id: UniversalIDCard
   - type: HealthAnalyzer
+    maxScanRange: null
     scanDelay: 0
     silent: true
   - type: CartridgeLoader