Pettable Animals (#6530)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
Willhelm53
2022-02-13 21:20:47 -06:00
committed by GitHub
parent ac23899a39
commit cd7843028b
20 changed files with 343 additions and 97 deletions

View File

@@ -1,5 +1,5 @@
using Content.Shared.Maps;
using Content.Shared.Window;
using Content.Shared.Tag;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -15,9 +15,10 @@ namespace Content.Shared.Construction.Conditions
{
public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
{
var tagSystem = EntitySystem.Get<TagSystem>();
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.IncludeAnchored))
{
if (IoCManager.Resolve<IEntityManager>().HasComponent<SharedWindowComponent>(entity))
if (tagSystem.HasTag(entity, "Window"))
return false;
}