You can now pick up items that are not on a grid.

API changes for IMapManager.TryGetGridAt().
This commit is contained in:
Acruid
2020-02-27 02:12:57 -08:00
parent a99919538c
commit 3011c06460
4 changed files with 21 additions and 14 deletions

View File

@@ -78,11 +78,16 @@ namespace Content.Server.GameObjects
public bool CanPickup(IEntity user)
{
var coords = Owner.Transform.GridPosition;
if (!ActionBlockerSystem.CanPickup(user)) return false;
if (user.Transform.MapID != Owner.Transform.MapID)
return false;
var userPos = user.Transform.MapPosition;
var itemPos = Owner.Transform.WorldPosition;
return _entitySystemManager.GetEntitySystem<InteractionSystem>()
.InRangeUnobstructed(coords, user.Transform.GridPosition, ignoredEnt:Owner);
.InRangeUnobstructed(userPos, itemPos, ignoredEnt: Owner);
}
public bool AttackHand(AttackHandEventArgs eventArgs)