]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
DoAfter fixes (#15127)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Tue, 4 Apr 2023 06:28:55 +0000 (18:28 +1200)
committerGitHub <noreply@github.com>
Tue, 4 Apr 2023 06:28:55 +0000 (23:28 -0700)
Content.Server/Construction/ConstructionSystem.Initial.cs
Content.Server/Power/EntitySystems/ApcSystem.cs
Content.Server/Repairable/RepairableSystem.cs
Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs

index dc002be2a4ff556bfd384bdc87100cef40c1f42d..c9e2f147fa8a2b25cff8f27b458ad5f65bf13ef1 100644 (file)
@@ -233,6 +233,9 @@ namespace Content.Server.Construction
                 BreakOnTargetMove = false,
                 BreakOnUserMove = true,
                 NeedHand = false,
+                // allow simultaneously starting several construction jobs using the same stack of materials.
+                CancelDuplicate = false,
+                BlockDuplicate = false,
             };
 
             if (await _doAfterSystem.WaitDoAfter(doAfterArgs) == DoAfterStatus.Cancelled)
@@ -481,13 +484,13 @@ namespace Content.Server.Construction
 
             // We do this to be able to move the construction to its proper position in case it's anchored...
             // Oh wow transform anchoring is amazing wow I love it!!!!
-            var wasAnchored = EntityManager.GetComponent<TransformComponent>(structure).Anchored;
-            EntityManager.GetComponent<TransformComponent>(structure).Anchored = false;
-
-            EntityManager.GetComponent<TransformComponent>(structure).Coordinates = ev.Location;
-            EntityManager.GetComponent<TransformComponent>(structure).LocalRotation = constructionPrototype.CanRotate ? ev.Angle : Angle.Zero;
-
-            EntityManager.GetComponent<TransformComponent>(structure).Anchored = wasAnchored;
+            // ikr
+            var xform = Transform(structure);
+            var wasAnchored = xform.Anchored;
+            xform.Anchored = false;
+            xform.Coordinates = ev.Location;
+            xform.LocalRotation = constructionPrototype.CanRotate ? ev.Angle : Angle.Zero;
+            xform.Anchored = wasAnchored;
 
             RaiseNetworkEvent(new AckStructureConstructionMessage(ev.Ack));
             _adminLogger.Add(LogType.Construction, LogImpact.Low, $"{ToPrettyString(user):player} has turned a {ev.PrototypeName} construction ghost into {ToPrettyString(structure)} at {Transform(structure).Coordinates}");
index 183422aa21ef7744f4ffe760f3e3bd0e8414152a..a66677970a6732e578d6ac0fb771dfaa9bc80369 100644 (file)
@@ -229,7 +229,7 @@ namespace Content.Server.Power.EntitySystems
 
         private void OnToolFinished(EntityUid uid, ApcComponent component, ApcToolFinishedEvent args)
         {
-            if (!args.Cancelled)
+            if (args.Cancelled)
                 return;
 
             component.IsApcOpen = !component.IsApcOpen;
index 56f1eb0903e87fc9270ead88a34db5e50f05a3a7..aada4715f053510f4b03d582a12b47ca66b75a6d 100644 (file)
@@ -65,7 +65,7 @@ namespace Content.Server.Repairable
                 delay *= component.SelfRepairPenalty;
 
             // Can the tool actually repair this, does it have enough fuel?
-            args.Handled = !_toolSystem.UseTool(args.Used, args.User, uid, delay, component.QualityNeeded, new RepairFinishedEvent(), component.FuelCost);
+            args.Handled = _toolSystem.UseTool(args.Used, args.User, uid, delay, component.QualityNeeded, new RepairFinishedEvent(), component.FuelCost);
         }
     }
 }
index 44313457f8351d76c1aff55d68f0f8d568cb3d09..84bed390dea7a5e6bbee3045070c36f2230dec47 100644 (file)
@@ -88,6 +88,7 @@ public sealed partial class RevenantSystem
         var searchDoAfter = new DoAfterArgs(uid, revenant.SoulSearchDuration, new SoulEvent(), uid, target: target)
         {
             BreakOnUserMove = true,
+            BreakOnDamage = true,
             DistanceThreshold = 2
         };
 
@@ -142,6 +143,7 @@ public sealed partial class RevenantSystem
         {
             DistanceThreshold = 2,
             BreakOnUserMove = true,
+            BreakOnDamage = true,
             RequireCanInteract = false, // stuns itself
         };