Refactor InRangeUnobstructed and add extension methods (#1925)
* Sort out InRangeUnobstructed and add extension methods * Rename client RangeChecks to RangeExtensions * Add container extension methods and test * Add missing component methods Component to container Grid coordinates to container Map coordinates to container Local player to container * Actually use the field * Merge fixes * Add popup argument to local player extension methods * Reduce code repetition for client range extensions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Content.Server.Utility;
|
||||
using Content.Shared.GameObjects.Components.Weapons;
|
||||
using Content.Shared.Utility;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
@@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components.Weapon
|
||||
{
|
||||
foreach (var entity in IoCManager.Resolve<IEntityManager>().GetEntitiesInRange(source.Transform.GridPosition, range))
|
||||
{
|
||||
if (!InteractionChecks.InRangeUnobstructed(source, entity.Transform.MapPosition, range, ignoredEnt:entity))
|
||||
if (!source.InRangeUnobstructed(entity, range, popup: true))
|
||||
continue;
|
||||
|
||||
if(entity.TryGetComponent(out FlashableComponent flashable))
|
||||
|
||||
Reference in New Issue
Block a user