]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix welder interaction (#14704)
author08A <git@08a.re>
Thu, 23 Mar 2023 17:08:46 +0000 (18:08 +0100)
committerGitHub <noreply@github.com>
Thu, 23 Mar 2023 17:08:46 +0000 (13:08 -0400)
Content.Server/IgnitionSource/IgnitionSourceSystem.cs
Content.Server/Tools/ToolSystem.Welder.cs
Content.Shared/Tools/Components/ToolComponent.cs
Content.Shared/Tools/Systems/SharedToolSystem.MultipleTool.cs

index 9f3b15614e57568c271ed72740261f7cbb238520..25a625180d0ff6de5b027b3a59c2f55ec518c489 100644 (file)
@@ -23,7 +23,6 @@ public sealed class IgnitionSourceSystem : EntitySystem
 
     private void OnIsHot(EntityUid uid, IgnitionSourceComponent component, IsHotEvent args)
     {
-        Logger.Debug(args.IsHot.ToString());
         SetIgnited(uid,component,args.IsHot);
     }
 
index 743a50263d400c79e08ec3794dae00ced2e90042..d50d4c106faa16beddb0076d2ed6575843409e78 100644 (file)
@@ -15,7 +15,6 @@ using Content.Shared.Weapons.Melee.Events;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
-using Robust.Shared.Player;
 
 namespace Content.Server.Tools
 {
@@ -302,6 +301,7 @@ namespace Content.Server.Tools
 
             if (neededFuel > fuel)
             {
+                _popupSystem.PopupEntity(Loc.GetString("welder-component-cannot-weld-message"), uid, args.User);
                 args.Cancel();
             }
 
index bae98e97126c1daedab56935d32960d822e64130..f631f66e200845afbca981463bed6e4ae12a99bf 100644 (file)
@@ -65,6 +65,7 @@ namespace Content.Shared.Tools.Components
 
         public ToolUseFinishAttemptEvent(float fuel, EntityUid user)
         {
+            User = user;
             Fuel = fuel;
         }
     }
index 3006c95b89cd026e28e5c31263315d430147ba5f..030c33f9cf3f15919d07cb426ff495c860923cef 100644 (file)
@@ -35,7 +35,7 @@ public abstract class SharedToolSystem : EntitySystem
         if (args.Handled || args.AdditionalData.Ev == null)
             return;
 
-        if (args.Cancelled)
+        if (args.Cancelled || !ToolFinishUse(uid, args.Args.User, args.AdditionalData.Fuel))
         {
             if (args.AdditionalData.CancelledEv != null)
             {
@@ -50,15 +50,12 @@ public abstract class SharedToolSystem : EntitySystem
             return;
         }
 
-        if (ToolFinishUse(uid, args.Args.User, args.AdditionalData.Fuel))
-        {
-            if (args.AdditionalData.TargetEntity != null)
-                RaiseLocalEvent(args.AdditionalData.TargetEntity.Value, args.AdditionalData.Ev);
-            else
-                RaiseLocalEvent(args.AdditionalData.Ev);
+        if (args.AdditionalData.TargetEntity != null)
+            RaiseLocalEvent(args.AdditionalData.TargetEntity.Value, args.AdditionalData.Ev);
+        else
+            RaiseLocalEvent(args.AdditionalData.Ev);
 
-            args.Handled = true;
-        }
+        args.Handled = true;
     }
 
     public bool UseTool(EntityUid tool, EntityUid user, EntityUid? target, float doAfterDelay, IEnumerable<string> toolQualitiesNeeded, ToolEventData toolEventData, float fuel = 0f, ToolComponent? toolComponent = null, Func<bool>? doAfterCheck = null, CancellationTokenSource? cancelToken = null)