Replace GetEntitiesInTile with EntityLookupSystem equivalent (#36756)
* commit GET!! * minor cleanup
This commit is contained in:
@@ -13,9 +13,13 @@ namespace Content.Shared.Construction.Conditions
|
|||||||
|
|
||||||
public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
|
public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
|
||||||
{
|
{
|
||||||
|
var entManager = IoCManager.Resolve<IEntityManager>();
|
||||||
|
var lookupSys = entManager.System<EntityLookupSystem>();
|
||||||
|
|
||||||
var result = false;
|
var result = false;
|
||||||
|
|
||||||
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.Static))
|
|
||||||
|
foreach (var entity in lookupSys.GetEntitiesIntersecting(location, LookupFlags.Approximate | LookupFlags.Static))
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedCanBuildWindowOnTopComponent>(entity))
|
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedCanBuildWindowOnTopComponent>(entity))
|
||||||
result = true;
|
result = true;
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ namespace Content.Shared.Construction.Conditions
|
|||||||
var entManager = IoCManager.Resolve<IEntityManager>();
|
var entManager = IoCManager.Resolve<IEntityManager>();
|
||||||
var sysMan = entManager.EntitySysManager;
|
var sysMan = entManager.EntitySysManager;
|
||||||
var tagSystem = sysMan.GetEntitySystem<TagSystem>();
|
var tagSystem = sysMan.GetEntitySystem<TagSystem>();
|
||||||
|
var lookupSys = sysMan.GetEntitySystem<EntityLookupSystem>();
|
||||||
|
|
||||||
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Static))
|
foreach (var entity in lookupSys.GetEntitiesIntersecting(location, LookupFlags.Static))
|
||||||
{
|
{
|
||||||
if (tagSystem.HasTag(entity, WindowTag))
|
if (tagSystem.HasTag(entity, WindowTag))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user