From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Tue, 4 Apr 2023 06:28:55 +0000 (+1200) Subject: DoAfter fixes (#15127) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=df3dae9093d386b09c73d27147c398b224b93932;p=space-station-14.git DoAfter fixes (#15127) --- diff --git a/Content.Server/Construction/ConstructionSystem.Initial.cs b/Content.Server/Construction/ConstructionSystem.Initial.cs index dc002be2a4..c9e2f147fa 100644 --- a/Content.Server/Construction/ConstructionSystem.Initial.cs +++ b/Content.Server/Construction/ConstructionSystem.Initial.cs @@ -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(structure).Anchored; - EntityManager.GetComponent(structure).Anchored = false; - - EntityManager.GetComponent(structure).Coordinates = ev.Location; - EntityManager.GetComponent(structure).LocalRotation = constructionPrototype.CanRotate ? ev.Angle : Angle.Zero; - - EntityManager.GetComponent(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}"); diff --git a/Content.Server/Power/EntitySystems/ApcSystem.cs b/Content.Server/Power/EntitySystems/ApcSystem.cs index 183422aa21..a66677970a 100644 --- a/Content.Server/Power/EntitySystems/ApcSystem.cs +++ b/Content.Server/Power/EntitySystems/ApcSystem.cs @@ -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; diff --git a/Content.Server/Repairable/RepairableSystem.cs b/Content.Server/Repairable/RepairableSystem.cs index 56f1eb0903..aada4715f0 100644 --- a/Content.Server/Repairable/RepairableSystem.cs +++ b/Content.Server/Repairable/RepairableSystem.cs @@ -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); } } } diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index 44313457f8..84bed390de 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -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 };