]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
add event to dna scrambling (#39862)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Fri, 10 Oct 2025 21:43:18 +0000 (23:43 +0200)
committerGitHub <noreply@github.com>
Fri, 10 Oct 2025 21:43:18 +0000 (21:43 +0000)
add event

Content.Shared/Trigger/Systems/DnaScrambleOnTriggerSystem.cs

index db27bd7f74b9b5126471ce2e528a3b0b459e3269..af5a73ffb6a42e3a95af7abf56dc9bc6acefe82d 100644 (file)
@@ -58,5 +58,17 @@ public sealed class DnaScrambleOnTriggerSystem : EntitySystem
 
         // Can't use PopupClient or PopupPredicted because the trigger might be unpredicted.
         _popup.PopupEntity(Loc.GetString("scramble-on-trigger-popup"), target.Value, target.Value);
+
+        var ev = new DnaScrambledEvent(target.Value);
+        RaiseLocalEvent(target.Value, ref ev, true);
     }
 }
+
+/// <summary>
+/// Raised after an entity has been DNA Scrambled.
+/// Useful for forks that need to run their own updates here.
+/// </summary>
+/// <param name="flag">The entity that had its DNA scrambled.</param>
+
+[ByRefEvent]
+public record struct DnaScrambledEvent(EntityUid Target);