mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
Fix crowbar distance to work on adjacent tiles (#424)
* Fix crowbar distance to work on max 1.5 tiles * Use existing distance methods * Use the existing InteractionRange
This commit is contained in:
parent
7032c8a92e
commit
e5150d3714
1 changed files with 11 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Content.Server.GameObjects.EntitySystems;
|
||||
using System;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
|
@ -27,6 +28,15 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
|
|||
{
|
||||
var mapGrid = _mapManager.GetGrid(eventArgs.ClickLocation.GridID);
|
||||
var tile = mapGrid.GetTileRef(eventArgs.ClickLocation);
|
||||
|
||||
var coordinates = mapGrid.GridTileToLocal(tile.GridIndices);
|
||||
float distance = coordinates.Distance(_mapManager, Owner.Transform.GridPosition);
|
||||
|
||||
if (distance > InteractionSystem.InteractionRange)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var tileDef = (ContentTileDefinition)_tileDefinitionManager[tile.Tile.TypeId];
|
||||
if (tileDef.CanCrowbar)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue