Add CanAttack to IActionBlocker, prevent using guns when dead (#769)
This commit is contained in:
committed by
GitHub
parent
5e2cac78ac
commit
d1ff84e95d
@@ -20,6 +20,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
bool CanPickup();
|
||||
|
||||
bool CanEmote();
|
||||
|
||||
bool CanAttack();
|
||||
}
|
||||
|
||||
public class ActionBlockerSystem : EntitySystem
|
||||
@@ -105,5 +107,17 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
return canemote;
|
||||
}
|
||||
|
||||
public static bool CanAttack(IEntity entity)
|
||||
{
|
||||
bool canattack = true;
|
||||
|
||||
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
|
||||
{
|
||||
canattack &= actionblockercomponents.CanAttack();
|
||||
}
|
||||
|
||||
return canattack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user