Created SharedInteractionSystem + Partial Fix #782 (#833)

This commit is contained in:
Sam
2020-04-22 00:58:31 +10:00
committed by GitHub
parent 3fc4725df7
commit 1ba222142a
3 changed files with 69 additions and 34 deletions

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using Content.Client.GameObjects.Components;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Robust.Client.GameObjects.EntitySystems;
using Robust.Client.Interfaces.GameObjects;
@@ -56,9 +57,10 @@ namespace Content.Client.State
var inRange = false;
if (_playerManager.LocalPlayer.ControlledEntity != null && entityToClick != null)
{
var playerPos = _playerManager.LocalPlayer.ControlledEntity.Transform.WorldPosition;
var playerPos = _playerManager.LocalPlayer.ControlledEntity.Transform.MapPosition;
var entityPos = entityToClick.Transform.WorldPosition;
inRange = (entityPos - playerPos).Length <= VerbUtility.InteractionRange;
inRange = _entitySystemManager.GetEntitySystem<SharedInteractionSystem>()
.InRangeUnobstructed(playerPos,entityPos,ignoredEnt: _playerManager.LocalPlayer.ControlledEntity);
}
InteractionOutlineComponent outline;