Fix antag shitcurity (#5441)
* fix jobs * Antagn't the heads and sec * good to go, time to test my code
This commit is contained in:
@@ -8,6 +8,7 @@ using Content.Server.Items;
|
|||||||
using Content.Server.Objectives.Interfaces;
|
using Content.Server.Objectives.Interfaces;
|
||||||
using Content.Server.PDA;
|
using Content.Server.PDA;
|
||||||
using Content.Server.Players;
|
using Content.Server.Players;
|
||||||
|
using Content.Server.Roles;
|
||||||
using Content.Server.Traitor;
|
using Content.Server.Traitor;
|
||||||
using Content.Server.Traitor.Uplink;
|
using Content.Server.Traitor.Uplink;
|
||||||
using Content.Server.Traitor.Uplink.Account;
|
using Content.Server.Traitor.Uplink.Account;
|
||||||
@@ -72,7 +73,10 @@ namespace Content.Server.GameTicking.Presets
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var list = new List<IPlayerSession>(readyPlayers);
|
var list = new List<IPlayerSession>(readyPlayers).Where(x =>
|
||||||
|
x.Data.ContentData()?.Mind?.AllRoles.All(role => role is not Job {CanBeAntag: false}) ?? false
|
||||||
|
).ToList();
|
||||||
|
|
||||||
var prefList = new List<IPlayerSession>();
|
var prefList = new List<IPlayerSession>();
|
||||||
|
|
||||||
foreach (var player in list)
|
foreach (var player in list)
|
||||||
|
|||||||
@@ -14,10 +14,13 @@ namespace Content.Server.Roles
|
|||||||
|
|
||||||
public string? StartingGear => Prototype.StartingGear;
|
public string? StartingGear => Prototype.StartingGear;
|
||||||
|
|
||||||
|
public bool CanBeAntag;
|
||||||
|
|
||||||
public Job(Mind.Mind mind, JobPrototype jobPrototype) : base(mind)
|
public Job(Mind.Mind mind, JobPrototype jobPrototype) : base(mind)
|
||||||
{
|
{
|
||||||
Prototype = jobPrototype;
|
Prototype = jobPrototype;
|
||||||
Name = jobPrototype.Name;
|
Name = jobPrototype.Name;
|
||||||
|
CanBeAntag = jobPrototype.CanBeAntag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Greet()
|
public override void Greet()
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ namespace Content.Shared.Roles
|
|||||||
[DataField("requireAdminNotify")]
|
[DataField("requireAdminNotify")]
|
||||||
public bool RequireAdminNotify { get; } = false;
|
public bool RequireAdminNotify { get; } = false;
|
||||||
|
|
||||||
|
[DataField("canBeAntag")]
|
||||||
|
public bool CanBeAntag { get; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether this job is a head.
|
/// Whether this job is a head.
|
||||||
/// The job system will try to pick heads before other jobs on the same priority level.
|
/// The job system will try to pick heads before other jobs on the same priority level.
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
joinNotifyCrew: true
|
joinNotifyCrew: true
|
||||||
supervisors: "Nanotrasen officials"
|
supervisors: "Nanotrasen officials"
|
||||||
|
canBeAntag: false
|
||||||
access:
|
access:
|
||||||
# All of em.
|
# All of em.
|
||||||
# Could probably do with some kind of wildcard or whatever to automate this.
|
# Could probably do with some kind of wildcard or whatever to automate this.
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
icon: "HeadOfPersonnel"
|
icon: "HeadOfPersonnel"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
supervisors: "the captain"
|
supervisors: "the captain"
|
||||||
|
canBeAntag: false
|
||||||
access:
|
access:
|
||||||
- Command
|
- Command
|
||||||
- HeadOfPersonnel
|
- HeadOfPersonnel
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
icon: "ChiefEngineer"
|
icon: "ChiefEngineer"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
supervisors: "the captain"
|
supervisors: "the captain"
|
||||||
|
canBeAntag: false
|
||||||
access:
|
access:
|
||||||
- Maintenance
|
- Maintenance
|
||||||
- Engineering
|
- Engineering
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
icon: "ChiefMedicalOfficer"
|
icon: "ChiefMedicalOfficer"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
supervisors: "the captain"
|
supervisors: "the captain"
|
||||||
|
canBeAntag: false
|
||||||
access:
|
access:
|
||||||
- Medical
|
- Medical
|
||||||
- Command
|
- Command
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
icon: "ResearchDirector"
|
icon: "ResearchDirector"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
supervisors: "the captain"
|
supervisors: "the captain"
|
||||||
|
canBeAntag: false
|
||||||
access:
|
access:
|
||||||
- Research
|
- Research
|
||||||
- Command
|
- Command
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
icon: "HeadOfSecurity"
|
icon: "HeadOfSecurity"
|
||||||
requireAdminNotify: true
|
requireAdminNotify: true
|
||||||
supervisors: "the captain"
|
supervisors: "the captain"
|
||||||
|
canBeAntag: false
|
||||||
access:
|
access:
|
||||||
- Command
|
- Command
|
||||||
- Brig
|
- Brig
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
- Security
|
- Security
|
||||||
icon: "SecurityOfficer"
|
icon: "SecurityOfficer"
|
||||||
supervisors: "the head of security"
|
supervisors: "the head of security"
|
||||||
|
canBeAntag: false
|
||||||
access:
|
access:
|
||||||
- Security
|
- Security
|
||||||
- Maintenance
|
- Maintenance
|
||||||
|
|||||||
Reference in New Issue
Block a user