Gun tweaks (#8320)

This commit is contained in:
metalgearsloth
2022-05-22 12:31:46 +10:00
committed by GitHub
parent c3fa24ccd8
commit 6e94d08b17
6 changed files with 42 additions and 8 deletions

View File

@@ -1,7 +1,9 @@
using Content.Client.CombatMode;
using Content.Client.Outline;
using Content.Client.Viewport;
using Content.Shared.ActionBlocker;
using Content.Shared.CCVar;
using Content.Shared.CombatMode;
using Content.Shared.DragDrop;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
@@ -35,6 +37,7 @@ namespace Content.Client.DragDrop
[Dependency] private readonly IConfigurationManager _cfgMan = default!;
[Dependency] private readonly InteractionOutlineSystem _outline = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly CombatModeSystem _combatMode = default!;
[Dependency] private readonly InputSystem _inputSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
@@ -124,7 +127,8 @@ namespace Content.Client.DragDrop
private bool OnUseMouseDown(in PointerInputCmdHandler.PointerInputCmdArgs args)
{
if (args.Session?.AttachedEntity is not {Valid: true} dragger)
if (args.Session?.AttachedEntity is not {Valid: true} dragger ||
_combatMode.IsInCombatMode())
{
return false;
}
@@ -218,7 +222,8 @@ namespace Content.Client.DragDrop
private bool OnContinueDrag(float frameTime)
{
if (_dragDropHelper.Dragged == default || Deleted(_dragDropHelper.Dragged))
if (_dragDropHelper.Dragged == default || Deleted(_dragDropHelper.Dragged) ||
_combatMode.IsInCombatMode())
{
return false;
}
@@ -231,8 +236,6 @@ namespace Content.Client.DragDrop
return false;
}
// keep dragged entity under mouse
var mousePos = _eyeManager.ScreenToMap(_dragDropHelper.MouseScreenPosition);
// TODO: would use MapPosition instead if it had a setter, but it has no setter.
// is that intentional, or should we add a setter for Transform.MapPosition?
if (_dragShadow == default)