Fixed bug where the mouse highlighting was always red on an entity when the grid was offset from the map origin.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Client.GameObjects.Components;
|
using Content.Client.GameObjects.Components;
|
||||||
using Content.Client.GameObjects.EntitySystems;
|
|
||||||
using Content.Shared.GameObjects;
|
using Content.Shared.GameObjects;
|
||||||
using Robust.Client.GameObjects.EntitySystems;
|
using Robust.Client.GameObjects.EntitySystems;
|
||||||
using Robust.Client.Interfaces.GameObjects;
|
using Robust.Client.Interfaces.GameObjects;
|
||||||
@@ -70,10 +69,9 @@ namespace Content.Client.State
|
|||||||
var inRange = false;
|
var inRange = false;
|
||||||
if (playerManager.LocalPlayer.ControlledEntity != null && entityToClick != null)
|
if (playerManager.LocalPlayer.ControlledEntity != null && entityToClick != null)
|
||||||
{
|
{
|
||||||
var playerPos = playerManager.LocalPlayer.ControlledEntity.Transform.GridPosition;
|
var playerPos = playerManager.LocalPlayer.ControlledEntity.Transform.WorldPosition;
|
||||||
var entityPos = entityToClick.Transform.GridPosition;
|
var entityPos = entityToClick.Transform.WorldPosition;
|
||||||
var distance = playerPos.Distance(_mapManager, entityPos);
|
inRange = (entityPos - playerPos).Length <= VerbUtility.InteractionRange;
|
||||||
inRange = distance <= VerbUtility.InteractionRange;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InteractionOutlineComponent outline;
|
InteractionOutlineComponent outline;
|
||||||
|
|||||||
Submodule RobustToolbox updated: 76933003ad...1545340d5c
Reference in New Issue
Block a user