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:
parent
dfe08d1262
commit
35dc6b2eee
2 changed files with 4 additions and 6 deletions
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Client.GameObjects.Components;
|
||||
using Content.Client.GameObjects.EntitySystems;
|
||||
using Content.Shared.GameObjects;
|
||||
using Robust.Client.GameObjects.EntitySystems;
|
||||
using Robust.Client.Interfaces.GameObjects;
|
||||
|
|
@ -70,10 +69,9 @@ namespace Content.Client.State
|
|||
var inRange = false;
|
||||
if (playerManager.LocalPlayer.ControlledEntity != null && entityToClick != null)
|
||||
{
|
||||
var playerPos = playerManager.LocalPlayer.ControlledEntity.Transform.GridPosition;
|
||||
var entityPos = entityToClick.Transform.GridPosition;
|
||||
var distance = playerPos.Distance(_mapManager, entityPos);
|
||||
inRange = distance <= VerbUtility.InteractionRange;
|
||||
var playerPos = playerManager.LocalPlayer.ControlledEntity.Transform.WorldPosition;
|
||||
var entityPos = entityToClick.Transform.WorldPosition;
|
||||
inRange = (entityPos - playerPos).Length <= VerbUtility.InteractionRange;
|
||||
}
|
||||
|
||||
InteractionOutlineComponent outline;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 76933003ad5fe6fc63a709e4157c770986313bd4
|
||||
Subproject commit 1545340d5caaa534ddbac3801ea0be29994c4585
|
||||
Loading…
Add table
Reference in a new issue