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:
committed by
GitHub
parent
c7a171cf14
commit
70c41f63b0
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user