From ad171ae310ba0108b959ce933a3296ba391403d9 Mon Sep 17 00:00:00 2001 From: ReeZer2 <63300653+ReeZer2@users.noreply.github.com> Date: Wed, 11 Sep 2024 21:46:23 +0300 Subject: [PATCH] FIX: No codewords for traitor without PDA (#1838) --- .../GameTicking/Rules/TraitorRuleSystem.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index cd1438ce711e..0a11b6932fd7 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -96,15 +96,18 @@ public bool MakeTraitor(EntityUid traitor, TraitorRuleComponent component, bool // creadth: we need to create uplink for the antag. // PDA should be in place already var pda = _uplink.FindUplinkTarget(traitor); - if (pda == null || !_uplink.AddUplink(traitor, startingBalance, giveDiscounts: true)) - return false; - // Give traitors their codewords and uplink code to keep in their character info menu - code = EnsureComp(pda.Value).Code; + //ss220 fix no codewords for traitor w/o pda start + if (pda != null && _uplink.AddUplink(traitor, startingBalance, giveDiscounts: true)) + { + // Give traitors their codewords and uplink code to keep in their character info menu + code = EnsureComp(pda.Value).Code; - // If giveUplink is false the uplink code part is omitted - briefing = string.Format("{0}\n{1}", briefing, - Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("-", code).Replace("sharp", "#")))); + // If giveUplink is false the uplink code part is omitted + briefing = string.Format("{0}\n{1}", briefing, + Loc.GetString("traitor-role-uplink-code-short", ("code", string.Join("-", code).Replace("sharp", "#")))); + } + //ss220 fix no codewords for traitor w/o pda end } _antag.SendBriefing(traitor, GenerateBriefing(component.Codewords, code, issuer), null, component.GreetSoundNotification);