Adds InRangeUnobstructed method to InteractionSystem (#698)

* You cannot pickup items across walls, or pickup items when dead/in crit.

* Adds InRangeUnobstructed method to InteractionSystem.
Changes HandsSystem and ItemComponent to use it.
This commit is contained in:
Víctor Aguilera Puerto
2020-02-16 23:04:06 +01:00
committed by GitHub
parent c7a171cf14
commit 70c41f63b0
6 changed files with 88 additions and 9 deletions

View File

@@ -17,6 +17,8 @@ namespace Content.Server.GameObjects.EntitySystems
bool CanDrop();
bool CanPickup();
bool CanEmote();
}
@@ -81,7 +83,17 @@ namespace Content.Server.GameObjects.EntitySystems
}
return candrop;
}
public static bool CanPickup(IEntity entity)
{
bool canpickup = true;
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
{
canpickup &= actionblockercomponents.CanPickup();
}
return canpickup;
}
public static bool CanEmote(IEntity entity)
{
bool canemote = true;