From 16b70ca8f6c9652a13bcce83a2a5766300d94153 Mon Sep 17 00:00:00 2001 From: Repo <47093363+Titian3@users.noreply.github.com> Date: Sun, 24 Sep 2023 09:00:12 +1300 Subject: [PATCH] Fix declaration of war (#20399) --- .../GameTicking/Rules/NukeopsRuleSystem.cs | 19 +++++++++++++++---- .../Syndicate_Gadgets/war_declarator.yml | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs index 4787b7d7dc..d94c9dae48 100644 --- a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs @@ -122,11 +122,14 @@ public sealed class NukeopsRuleSystem : GameRuleSystem 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 //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()) + { + nukeops.OperativePlayers.Add(mind.CharacterName!, mind.CurrentEntity.GetValueOrDefault()); + } + } + SetOutfitCommand.SetOutfit(mind.OwnedEntity.Value, "SyndicateOperativeGearFull", EntityManager); } diff --git a/Resources/Prototypes/Entities/Objects/Devices/Syndicate_Gadgets/war_declarator.yml b/Resources/Prototypes/Entities/Objects/Devices/Syndicate_Gadgets/war_declarator.yml index 9a1dc0f95e..da4f4710cc 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Syndicate_Gadgets/war_declarator.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Syndicate_Gadgets/war_declarator.yml @@ -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 -- 2.51.2