Fix prying speed & log (#29210)

* cleanup prototypes with `PryingComponent` & fix jaws of life prying speed

* Minor cleanup for tools and prying systems

Remove some obsolete methods.

* Fix doafter continues when not held & log

* Modifiy delays for floor prying

* Fix test fail
This commit is contained in:
MilenVolf
2024-06-20 17:19:22 +03:00
committed by GitHub
parent c91789a78d
commit 50146d4b98
12 changed files with 31 additions and 70 deletions

View File

@@ -21,7 +21,7 @@ public sealed class PryingSystem : EntitySystem
[Dependency] private readonly ISharedAdminLogManager _adminLog = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] private readonly SharedPopupSystem Popup = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
public override void Initialize()
{
@@ -46,7 +46,7 @@ public sealed class PryingSystem : EntitySystem
if (!args.CanInteract || !args.CanAccess)
return;
if (!TryComp<PryingComponent>(args.User, out var tool))
if (!TryComp<PryingComponent>(args.User, out _))
return;
args.Verbs.Add(new AlternativeVerb()
@@ -74,7 +74,7 @@ public sealed class PryingSystem : EntitySystem
if (!CanPry(target, user, out var message, comp))
{
if (!string.IsNullOrWhiteSpace(message))
Popup.PopupClient(Loc.GetString(message), target, user);
_popup.PopupClient(Loc.GetString(message), target, user);
// If we have reached this point we want the event that caused this
// to be marked as handled.
return true;
@@ -138,9 +138,10 @@ public sealed class PryingSystem : EntitySystem
{
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = tool != user,
};
if (tool != null)
if (tool != user && tool != null)
{
_adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is using {ToPrettyString(tool.Value)} to pry {ToPrettyString(target)}");
}
@@ -163,7 +164,7 @@ public sealed class PryingSystem : EntitySystem
if (!CanPry(uid, args.User, out var message, comp))
{
if (!string.IsNullOrWhiteSpace(message))
Popup.PopupClient(Loc.GetString(message), uid, args.User);
_popup.PopupClient(Loc.GetString(message), uid, args.User);
return;
}
@@ -178,6 +179,4 @@ public sealed class PryingSystem : EntitySystem
}
[Serializable, NetSerializable]
public sealed partial class DoorPryDoAfterEvent : SimpleDoAfterEvent
{
}
public sealed partial class DoorPryDoAfterEvent : SimpleDoAfterEvent;