mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-02-14 19:29:57 +01:00
Fix ore silo clients showing up when out of range (#36741)
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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.
|
||||
/// </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))
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user