Add AntagPrototype to TraitorRole and Fix traitors choice logic (#5861)

This commit is contained in:
Morbo
2021-12-26 06:13:37 +03:00
committed by GitHub
parent 651c11888f
commit 7d28108572
7 changed files with 24 additions and 11 deletions

View File

@@ -20,6 +20,7 @@ using Content.Shared.Damage.Prototypes;
using Content.Shared.Inventory;
using Content.Shared.MobState.Components;
using Content.Shared.PDA;
using Content.Shared.Roles;
using Content.Shared.Traitor.Uplink;
using Robust.Server.Player;
using Robust.Shared.Configuration;
@@ -52,6 +53,8 @@ public class TraitorDeathMatchRuleSystem : GameRuleSystem
private readonly Dictionary<UplinkAccount, string> _allOriginalNames = new();
private const string TraitorPrototypeID = "Traitor";
public override void Initialize()
{
base.Initialize();
@@ -77,7 +80,8 @@ public class TraitorDeathMatchRuleSystem : GameRuleSystem
return;
}
var traitorRole = new TraitorRole(mind);
var antagPrototype = _prototypeManager.Index<AntagPrototype>(TraitorPrototypeID);
var traitorRole = new TraitorRole(mind, antagPrototype);
mind.AddRole(traitorRole);
// Delete anything that may contain "dangerous" role-specific items.