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);
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),
/// Checks if a given client fulfills the criteria to link/receive materials from an ore silo.
/// </summary>
[PublicAPI]
- public bool CanTransmitMaterials(Entity<OreSiloComponent?> silo, EntityUid client)
+ public bool CanTransmitMaterials(Entity<OreSiloComponent?, TransformComponent?> 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))
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;