From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sun, 20 Apr 2025 01:00:23 +0000 (-0400) Subject: Fix ore silo clients showing up when out of range (#36741) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=f04f19a7aa0259eee9acbb61948126f9ac224589;p=space-station-14.git Fix ore silo clients showing up when out of range (#36741) --- diff --git a/Content.Server/Materials/OreSiloSystem.cs b/Content.Server/Materials/OreSiloSystem.cs index 87e6db16cf..a0aab4fcae 100644 --- a/Content.Server/Materials/OreSiloSystem.cs +++ b/Content.Server/Materials/OreSiloSystem.cs @@ -39,6 +39,10 @@ public sealed class OreSiloSystem : SharedOreSiloSystem if (client.Comp.Silo is not null) continue; + // Don't show clients on the screen if we can't link them. + if (!CanTransmitMaterials((ent, ent, xform), client)) + continue; + var netEnt = GetNetEntity(client); var name = Identity.Name(client, EntityManager); var beacon = _navMap.GetNearestBeaconString(client.Owner, onlyName: true); @@ -58,7 +62,7 @@ public sealed class OreSiloSystem : SharedOreSiloSystem var netEnt = GetNetEntity(client); var name = Identity.Name(client, EntityManager); var beacon = _navMap.GetNearestBeaconString(client, onlyName: true); - var inRange = CanTransmitMaterials((ent, ent), client); + var inRange = CanTransmitMaterials((ent, ent, xform), client); var txt = Loc.GetString("ore-silo-ui-itemlist-entry", ("name", name), diff --git a/Content.Shared/Materials/OreSilo/SharedOreSiloSystem.cs b/Content.Shared/Materials/OreSilo/SharedOreSiloSystem.cs index 729a710065..33168db1db 100644 --- a/Content.Shared/Materials/OreSilo/SharedOreSiloSystem.cs +++ b/Content.Shared/Materials/OreSilo/SharedOreSiloSystem.cs @@ -149,9 +149,9 @@ public abstract class SharedOreSiloSystem : EntitySystem /// Checks if a given client fulfills the criteria to link/receive materials from an ore silo. /// [PublicAPI] - public bool CanTransmitMaterials(Entity silo, EntityUid client) + public bool CanTransmitMaterials(Entity silo, EntityUid client) { - if (!Resolve(silo, ref silo.Comp)) + if (!Resolve(silo, ref silo.Comp1, ref silo.Comp2)) return false; if (!_powerReceiver.IsPowered(silo.Owner)) @@ -160,7 +160,7 @@ public abstract class SharedOreSiloSystem : EntitySystem if (_transform.GetGrid(client) != _transform.GetGrid(silo.Owner)) return false; - if (!_transform.InRange(silo.Owner, client, silo.Comp.Range)) + if (!_transform.InRange((silo.Owner, silo.Comp2), client, silo.Comp1.Range)) return false; return true;