Replaces anchored lookup flag with static (#13036)
This commit is contained in:
@@ -379,7 +379,7 @@ namespace Content.Client.DragDrop
|
|||||||
// TODO: Duplicated in SpriteSystem and TargetOutlineSystem. Should probably be cached somewhere for a frame?
|
// TODO: Duplicated in SpriteSystem and TargetOutlineSystem. Should probably be cached somewhere for a frame?
|
||||||
var mousePos = _eyeManager.ScreenToMap(_inputManager.MouseScreenPosition).Position;
|
var mousePos = _eyeManager.ScreenToMap(_inputManager.MouseScreenPosition).Position;
|
||||||
var bounds = new Box2(mousePos - 1.5f, mousePos + 1.5f);
|
var bounds = new Box2(mousePos - 1.5f, mousePos + 1.5f);
|
||||||
var pvsEntities = _lookup.GetEntitiesIntersecting(_eyeManager.CurrentMap, bounds, LookupFlags.Approximate | LookupFlags.Anchored);
|
var pvsEntities = _lookup.GetEntitiesIntersecting(_eyeManager.CurrentMap, bounds, LookupFlags.Approximate | LookupFlags.Static);
|
||||||
foreach (var pvsEntity in pvsEntities)
|
foreach (var pvsEntity in pvsEntities)
|
||||||
{
|
{
|
||||||
if (!EntityManager.TryGetComponent(pvsEntity, out SpriteComponent? inRangeSprite) ||
|
if (!EntityManager.TryGetComponent(pvsEntity, out SpriteComponent? inRangeSprite) ||
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public sealed class TargetOutlineSystem : EntitySystem
|
|||||||
// TODO: Duplicated in SpriteSystem and DragDropSystem. Should probably be cached somewhere for a frame?
|
// TODO: Duplicated in SpriteSystem and DragDropSystem. Should probably be cached somewhere for a frame?
|
||||||
var mousePos = _eyeManager.ScreenToMap(_inputManager.MouseScreenPosition).Position;
|
var mousePos = _eyeManager.ScreenToMap(_inputManager.MouseScreenPosition).Position;
|
||||||
var bounds = new Box2(mousePos - LookupSize / 2f, mousePos + LookupSize / 2f);
|
var bounds = new Box2(mousePos - LookupSize / 2f, mousePos + LookupSize / 2f);
|
||||||
var pvsEntities = _lookup.GetEntitiesIntersecting(_eyeManager.CurrentMap, bounds, LookupFlags.Approximate | LookupFlags.Anchored);
|
var pvsEntities = _lookup.GetEntitiesIntersecting(_eyeManager.CurrentMap, bounds, LookupFlags.Approximate | LookupFlags.Static);
|
||||||
var spriteQuery = GetEntityQuery<SpriteComponent>();
|
var spriteQuery = GetEntityQuery<SpriteComponent>();
|
||||||
|
|
||||||
foreach (var entity in pvsEntities)
|
foreach (var entity in pvsEntities)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public sealed class TetherGunSystem : SharedTetherGunSystem
|
|||||||
var bodyQuery = GetEntityQuery<PhysicsComponent>();
|
var bodyQuery = GetEntityQuery<PhysicsComponent>();
|
||||||
var lowest = new List<(int DrawDepth, uint RenderOrder, EntityUid Entity)>();
|
var lowest = new List<(int DrawDepth, uint RenderOrder, EntityUid Entity)>();
|
||||||
|
|
||||||
foreach (var ent in _lookup.GetEntitiesIntersecting(mousePos, LookupFlags.Approximate | LookupFlags.Anchored))
|
foreach (var ent in _lookup.GetEntitiesIntersecting(mousePos, LookupFlags.Approximate | LookupFlags.Static))
|
||||||
{
|
{
|
||||||
if (!bodyQuery.HasComponent(ent) ||
|
if (!bodyQuery.HasComponent(ent) ||
|
||||||
!TryComp<ClickableComponent>(ent, out var clickable) ||
|
!TryComp<ClickableComponent>(ent, out var clickable) ||
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace Content.Server.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Suicide by nearby entity (ex: Microwave)
|
// Suicide by nearby entity (ex: Microwave)
|
||||||
foreach (var entity in _entityLookupSystem.GetEntitiesInRange(victim, 1, LookupFlags.Approximate | LookupFlags.Anchored))
|
foreach (var entity in _entityLookupSystem.GetEntitiesInRange(victim, 1, LookupFlags.Approximate | LookupFlags.Static))
|
||||||
{
|
{
|
||||||
// Skip any nearby items that can be picked up, we already checked the active held item above
|
// Skip any nearby items that can be picked up, we already checked the active held item above
|
||||||
if (itemQuery.HasComponent(entity))
|
if (itemQuery.HasComponent(entity))
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace Content.Server.Construction.Conditions
|
|||||||
|
|
||||||
var indices = transform.Coordinates.ToVector2i(entityManager, IoCManager.Resolve<IMapManager>());
|
var indices = transform.Coordinates.ToVector2i(entityManager, IoCManager.Resolve<IMapManager>());
|
||||||
var lookup = entityManager.EntitySysManager.GetEntitySystem<EntityLookupSystem>();
|
var lookup = entityManager.EntitySysManager.GetEntitySystem<EntityLookupSystem>();
|
||||||
var entities = indices.GetEntitiesInTile(transform.GridUid.Value, LookupFlags.Approximate | LookupFlags.Anchored, lookup);
|
var entities = indices.GetEntitiesInTile(transform.GridUid.Value, LookupFlags.Approximate | LookupFlags.Static, lookup);
|
||||||
|
|
||||||
foreach (var ent in entities)
|
foreach (var ent in entities)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ namespace Content.Server.Electrocution
|
|||||||
if (electrified.NoWindowInTile)
|
if (electrified.NoWindowInTile)
|
||||||
{
|
{
|
||||||
foreach (var entity in transform.Coordinates.GetEntitiesInTile(
|
foreach (var entity in transform.Coordinates.GetEntitiesInTile(
|
||||||
LookupFlags.Approximate | LookupFlags.Anchored, _entityLookup))
|
LookupFlags.Approximate | LookupFlags.Static, _entityLookup))
|
||||||
{
|
{
|
||||||
if (_tagSystem.HasTag(entity, "Window"))
|
if (_tagSystem.HasTag(entity, "Window"))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ public sealed partial class RevenantSystem
|
|||||||
value.PryTile();
|
value.PryTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
var lookup = _lookup.GetEntitiesInRange(uid, component.DefileRadius, LookupFlags.Approximate | LookupFlags.Anchored);
|
var lookup = _lookup.GetEntitiesInRange(uid, component.DefileRadius, LookupFlags.Approximate | LookupFlags.Static);
|
||||||
var tags = GetEntityQuery<TagComponent>();
|
var tags = GetEntityQuery<TagComponent>();
|
||||||
var entityStorage = GetEntityQuery<EntityStorageComponent>();
|
var entityStorage = GetEntityQuery<EntityStorageComponent>();
|
||||||
var items = GetEntityQuery<ItemComponent>();
|
var items = GetEntityQuery<ItemComponent>();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Content.Shared.Construction.Conditions
|
|||||||
{
|
{
|
||||||
var result = false;
|
var result = false;
|
||||||
|
|
||||||
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.Anchored))
|
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.Static))
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedCanBuildWindowOnTopComponent>(entity))
|
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedCanBuildWindowOnTopComponent>(entity))
|
||||||
result = true;
|
result = true;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Content.Shared.Construction.Conditions
|
|||||||
{
|
{
|
||||||
var tagSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<TagSystem>();
|
var tagSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<TagSystem>();
|
||||||
|
|
||||||
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.Anchored))
|
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.Static))
|
||||||
{
|
{
|
||||||
if (tagSystem.HasTag(entity, "Window"))
|
if (tagSystem.HasTag(entity, "Window"))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ namespace Content.Shared.Maps
|
|||||||
/// Helper that returns all entities in a turf.
|
/// Helper that returns all entities in a turf.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static IEnumerable<EntityUid> GetEntitiesInTile(this TileRef turf, LookupFlags flags = LookupFlags.Anchored, EntityLookupSystem? lookupSystem = null)
|
public static IEnumerable<EntityUid> GetEntitiesInTile(this TileRef turf, LookupFlags flags = LookupFlags.Static, EntityLookupSystem? lookupSystem = null)
|
||||||
{
|
{
|
||||||
lookupSystem ??= EntitySystem.Get<EntityLookupSystem>();
|
lookupSystem ??= EntitySystem.Get<EntityLookupSystem>();
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ namespace Content.Shared.Maps
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper that returns all entities in a turf.
|
/// Helper that returns all entities in a turf.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static IEnumerable<EntityUid> GetEntitiesInTile(this EntityCoordinates coordinates, LookupFlags flags = LookupFlags.Anchored, EntityLookupSystem? lookupSystem = null)
|
public static IEnumerable<EntityUid> GetEntitiesInTile(this EntityCoordinates coordinates, LookupFlags flags = LookupFlags.Static, EntityLookupSystem? lookupSystem = null)
|
||||||
{
|
{
|
||||||
var turf = coordinates.GetTileRef();
|
var turf = coordinates.GetTileRef();
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ namespace Content.Shared.Maps
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper that returns all entities in a turf.
|
/// Helper that returns all entities in a turf.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static IEnumerable<EntityUid> GetEntitiesInTile(this Vector2i indices, EntityUid gridId, LookupFlags flags = LookupFlags.Anchored, EntityLookupSystem? lookupSystem = null)
|
public static IEnumerable<EntityUid> GetEntitiesInTile(this Vector2i indices, EntityUid gridId, LookupFlags flags = LookupFlags.Static, EntityLookupSystem? lookupSystem = null)
|
||||||
{
|
{
|
||||||
return GetEntitiesInTile(indices.GetTileRef(gridId), flags, lookupSystem);
|
return GetEntitiesInTile(indices.GetTileRef(gridId), flags, lookupSystem);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user