Modify damage logging. (#5579)

This commit is contained in:
Leon Friedrich
2021-11-29 02:34:44 +13:00
committed by GitHub
parent b807250021
commit 0de4b7bc9f
28 changed files with 265 additions and 62 deletions

View File

@@ -8,6 +8,7 @@ using Content.Server.Items;
using Content.Server.Stack;
using Content.Server.Storage.Components;
using Content.Server.Throwing;
using Content.Shared.ActionBlocker;
using Content.Shared.Examine;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
@@ -35,6 +36,7 @@ namespace Content.Server.Hands.Systems
[Dependency] private readonly InteractionSystem _interactionSystem = default!;
[Dependency] private readonly StackSystem _stackSystem = default!;
[Dependency] private readonly HandVirtualItemSystem _virtualItemSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
public override void Initialize()
{
@@ -223,7 +225,7 @@ namespace Content.Server.Hands.Systems
playerEnt.IsInContainer() ||
!playerEnt.TryGetComponent(out SharedHandsComponent? hands) ||
!hands.TryGetActiveHeldEntity(out var throwEnt) ||
!_interactionSystem.TryThrowInteraction(hands.Owner, throwEnt))
!_actionBlockerSystem.CanThrow(playerEnt.Uid))
return false;
if (throwEnt.TryGetComponent(out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)