]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix random test fail in DeleteAllThenGhost (#32753)
authorErrant <35878406+Errant-4@users.noreply.github.com>
Fri, 11 Oct 2024 19:17:01 +0000 (21:17 +0200)
committerGitHub <noreply@github.com>
Fri, 11 Oct 2024 19:17:01 +0000 (21:17 +0200)
It's simple. We kill the heisentest

Content.Shared/Roles/SharedRoleSystem.cs

index cd3fe141b2be8d8ef5ca875712bc952424dcb9c7..925f61e7c75dd2d8f2c367273ba5915dd0d77074 100644 (file)
@@ -478,7 +478,13 @@ public abstract class SharedRoleSystem : EntitySystem
         var exclusiveAntag = false;
         foreach (var role in mind.MindRoles)
         {
-            var roleComp = Comp<MindRoleComponent>(role);
+            if (!TryComp<MindRoleComponent>(role, out var roleComp))
+            {
+                //If this ever shows up outside of an integration test, then we need to look into this further.
+                Log.Warning($"Mind Role Entity {role} does not have MindRoleComponent!");
+                continue;
+            }
+
             if (roleComp.Antag || exclusiveAntag)
                 antagonist = true;
             if (roleComp.ExclusiveAntag)