]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix DoAfter attempt event null error (#27280)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Thu, 25 Apr 2024 01:54:25 +0000 (13:54 +1200)
committerGitHub <noreply@github.com>
Thu, 25 Apr 2024 01:54:25 +0000 (11:54 +1000)
* Fix DoAfter attempt event null error

* A

Content.Shared/DoAfter/DoAfterEvent.cs
Content.Shared/DoAfter/SharedDoAfterSystem.Update.cs
Content.Shared/DoAfter/SharedDoAfterSystem.cs

index c01505f9b259c7ab54aa8177196d760f7bf6e2cc..bc9abdab87b693535d62f12b336445bfaf567437 100644 (file)
@@ -73,7 +73,7 @@ public sealed partial class DoAfterAttemptEvent<TEvent> : CancellableEntityEvent
     public readonly DoAfter DoAfter;
 
     /// <summary>
-    ///     The event that the DoAfter will raise after sucesfully finishing. Given that this event has the data
+    ///     The event that the DoAfter will raise after successfully finishing. Given that this event has the data
     ///     required to perform the interaction, it should also contain the data required to validate/attempt the
     ///     interaction.
     /// </summary>
index 455491f5242a720a4dff81d5a18a402b954a50f7..4f77a271b37bd4febeb783d4a8d253e7bfc7f1db 100644 (file)
@@ -104,6 +104,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
             doAfter.AttemptEvent = _factory.CreateInstance(evType, new object[] { doAfter, args.Event });
         }
 
+        args.Event.DoAfter = doAfter;
         if (args.EventTarget != null)
             RaiseLocalEvent(args.EventTarget.Value, doAfter.AttemptEvent, args.Broadcast);
         else
index d20da4948583da72ead8c968e331eb423a41c4d2..9ad649683dd0e2bc56fedbc4463466ef021f80f7 100644 (file)
@@ -245,8 +245,9 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
         if (args.AttemptFrequency == AttemptFrequency.StartAndEnd && !TryAttemptEvent(doAfter))
             return false;
 
-        if (args.Delay <= TimeSpan.Zero ||
-            _tag.HasTag(args.User, "InstantDoAfters"))
+        // TODO DO AFTER
+        // Why does this tag exist? Just make this a bool on the component?
+        if (args.Delay <= TimeSpan.Zero || _tag.HasTag(args.User, "InstantDoAfters"))
         {
             RaiseDoAfterEvents(doAfter, comp);
             // We don't store instant do-afters. This is just a lazy way of hiding them from client-side visuals.