]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Makes ActivateItemInWorld open the stripping menu (#13786)
authoradamsong <adamsong@users.noreply.github.com>
Sat, 11 Feb 2023 02:06:09 +0000 (21:06 -0500)
committerGitHub <noreply@github.com>
Sat, 11 Feb 2023 02:06:09 +0000 (02:06 +0000)
Content.Server/Strip/StrippableSystem.cs

index 08c71c8fe7a04bcd34f56abe932829c86a1dedf3..4acc65fba270c193d3a9db19a2c7e5e6f094c055 100644 (file)
@@ -16,6 +16,7 @@ using System.Threading;
 using Content.Server.Administration.Logs;
 using Content.Shared.Database;
 using Content.Shared.Ensnaring.Components;
+using Content.Shared.Interaction;
 
 namespace Content.Server.Strip
 {
@@ -37,6 +38,7 @@ namespace Content.Server.Strip
 
             SubscribeLocalEvent<StrippableComponent, GetVerbsEvent<Verb>>(AddStripVerb);
             SubscribeLocalEvent<StrippableComponent, GetVerbsEvent<ExamineVerb>>(AddStripExamineVerb);
+            SubscribeLocalEvent<StrippableComponent, ActivateInWorldEvent>(OnActivateInWorld);
 
             // BUI
             SubscribeLocalEvent<StrippableComponent, StrippingSlotButtonPressed>(OnStripButtonPressed);
@@ -151,6 +153,17 @@ namespace Content.Server.Strip
             args.Verbs.Add(verb);
         }
 
+        private void OnActivateInWorld(EntityUid uid, StrippableComponent component, ActivateInWorldEvent args)
+        {
+            if (args.Target == args.User)
+                return;
+
+            if (!TryComp<ActorComponent>(args.User, out var actor))
+                return;
+
+            StartOpeningStripper(args.User, component);
+        }
+
         /// <summary>
         ///     Places item in user's active hand to an inventory slot.
         /// </summary>