You can now pick up items that are not on a grid.
API changes for IMapManager.TryGetGridAt().
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user