]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix declaration of war (#20399)
authorRepo <47093363+Titian3@users.noreply.github.com>
Sat, 23 Sep 2023 20:00:12 +0000 (09:00 +1300)
committerGitHub <noreply@github.com>
Sat, 23 Sep 2023 20:00:12 +0000 (12:00 -0800)
Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs
Resources/Prototypes/Entities/Objects/Devices/Syndicate_Gadgets/war_declarator.yml

index 4787b7d7dca9e501614ffcb87b27149814a2f235..d94c9dae48ffef5378bb861afdd06df81e870ad8 100644 (file)
@@ -122,11 +122,14 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
             if (!GameTicker.IsGameRuleAdded(ruleEnt, gameRule))
                 continue;
 
-            var found = nukeops.OperativePlayers.Values.Any(v => v == opUid);
-            if (found)
+            if (_mind.TryGetMind(opUid, out var mind, out _))
             {
-                comps = (nukeops, gameRule);
-                return true;
+                var found = nukeops.OperativePlayers.Values.Any(v => v == mind);
+                if (found)
+                {
+                    comps = (nukeops, gameRule);
+                    return true;
+                }
             }
         }
 
@@ -990,6 +993,14 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
 
         //ok hardcoded value bad but so is everything else here
         _roles.MindAddRole(mindId, new NukeopsRoleComponent { PrototypeId = NukeopsId }, mind);
+        if (mind.CurrentEntity != null)
+        {
+            foreach (var (nukeops, gameRule) in EntityQuery<NukeopsRuleComponent, GameRuleComponent>())
+            {
+                nukeops.OperativePlayers.Add(mind.CharacterName!, mind.CurrentEntity.GetValueOrDefault());
+            }
+        }
+
         SetOutfitCommand.SetOutfit(mind.OwnedEntity.Value, "SyndicateOperativeGearFull", EntityManager);
     }
 
index 9a1dc0f95e1eaca9e99e30f3e29d27b17895a98f..da4f4710cc5af0a9ea550a33f298406cffd9d96f 100644 (file)
@@ -1,7 +1,7 @@
 - type: entity
   parent: BaseItem
   id: NukeOpsDeclarationOfWar
-  name: the declaration of war
+  name: declaration of war
   description: Use to send a declaration of hostilities to the target, delaying your shuttle departure while they prepare for your assault. Such a brazen move will attract the attention of powerful benefactors within the Syndicate, who will supply your team with a massive amount of bonus telecrystals. Must be used at start of mission, or your benefactors will lose interest.
   components:
     - type: Sprite