Cleanup SharedRoleCodewordSystem (#38310)

* cleanup

* Update Content.Shared/Roles/RoleCodeword/SharedRoleCodewordSystem.cs

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>

* Apply suggestions from code review

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
This commit is contained in:
slarticodefast
2025-06-27 02:27:25 +02:00
committed by GitHub
parent 75db49f9c0
commit a3b82e9afd
3 changed files with 6 additions and 47 deletions

View File

@@ -133,11 +133,11 @@ public sealed class TraitorRuleSystem : GameRuleSystem<TraitorRuleComponent>
Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - did not get traitor briefing");
}
// Send codewords to only the traitor client
var color = TraitorCodewordColor; // Fall back to a dark red Syndicate color if a prototype is not found
RoleCodewordComponent codewordComp = EnsureComp<RoleCodewordComponent>(mindId);
_roleCodewordSystem.SetRoleCodewords(codewordComp, "traitor", factionCodewords.ToList(), color);
// The mind entity is stored in nullspace with a PVS override for the owner, so only they can see the codewords.
var codewordComp = EnsureComp<RoleCodewordComponent>(mindId);
_roleCodewordSystem.SetRoleCodewords((mindId, codewordComp), "traitor", factionCodewords.ToList(), color);
// Change the faction
Log.Debug($"MakeTraitor {ToPrettyString(traitor)} - Change faction");