Misc action fixes (#12046)

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2022-10-20 01:02:38 +13:00
committed by GitHub
parent 77fa2d50f1
commit f12d4a13d6
8 changed files with 158 additions and 38 deletions

View File

@@ -180,24 +180,18 @@ namespace Content.Client.Actions
private void OnPlayerAttached(EntityUid uid, ActionsComponent component, PlayerAttachedEvent args)
{
if (uid != _playerManager.LocalPlayer?.ControlledEntity)
return;
LinkAllActions(component);
}
private void OnPlayerDetached(EntityUid uid, ActionsComponent component, PlayerDetachedEvent? args = null)
{
if (uid != _playerManager.LocalPlayer?.ControlledEntity)
return;
UnlinkAllActions();
}
public void UnlinkAllActions()
{
UnlinkActions?.Invoke();
PlayerActions = null;
UnlinkActions?.Invoke();
}
public void LinkAllActions(ActionsComponent? actions = null)