Reduce action blocker uses and add target entity to CanInteract (#6655)

This commit is contained in:
Leon Friedrich
2022-02-15 17:06:52 +13:00
committed by GitHub
parent 334568dad2
commit ad9ddf1552
60 changed files with 286 additions and 402 deletions

View File

@@ -49,9 +49,6 @@ namespace Content.Server.Arcade.Components
if(!Powered || !IoCManager.Resolve<IEntityManager>().TryGetComponent(eventArgs.User, out ActorComponent? actor))
return;
if(!EntitySystem.Get<ActionBlockerSystem>().CanInteract(eventArgs.User))
return;
UserInterface?.Toggle(actor.PlayerSession);
if (UserInterface?.SessionHasOpen(actor.PlayerSession) == true)
{
@@ -130,13 +127,6 @@ namespace Content.Server.Arcade.Components
case BlockGameMessages.BlockGamePlayerActionMessage playerActionMessage:
if (obj.Session != _player) break;
// TODO: Should this check if the Owner can interact...?
if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(Owner))
{
DeactivePlayer(obj.Session);
break;
}
if (playerActionMessage.PlayerAction == BlockGamePlayerAction.NewGame)
{
if(_game?.Started == true) _game = new BlockGame(this);