-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choose Antags Before Job Selection #1059
base: master
Are you sure you want to change the base?
Changes from all commits
c1356c6
576961a
6f039d8
6a7aca4
b2e7a3e
4ba5c21
63680c2
3b56abe
f9c8174
bb42319
fac9c67
a119930
bb404af
b00a545
465a1bf
3b2ae5f
0cb710c
6afee5a
a1e2416
a1d0474
b22eee3
fbddda3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using System.Linq; | ||
using Content.Server.Antag; | ||
using Content.Server.Administration.Managers; | ||
using Content.Server.Players.PlayTimeTracking; | ||
using Content.Server.Station.Components; | ||
|
@@ -17,6 +18,7 @@ public sealed partial class StationJobsSystem | |
{ | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly IBanManager _banManager = default!; | ||
[Dependency] private readonly AntagSelectionSystem _antag = default!; | ||
|
||
private Dictionary<int, HashSet<string>> _jobsByWeight = default!; | ||
private List<int> _orderedWeights = default!; | ||
|
@@ -361,6 +363,9 @@ private Dictionary<NetUserId, List<string>> GetPlayersJobCandidates(int? weight, | |
if (!_prototypeManager.TryIndex(jobId, out var job)) | ||
continue; | ||
|
||
if (!job.CanBeAntag && _antag.QueuedAntags.ContainsKey(player)) | ||
continue; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there any protection for if a player only has antagimmune jobs enabled for their chosen character? or can they sometimes be dumped into passenger / held in the lobby by this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pretty sure they will just get put out into the lobby, but I also think this is handled when the antag pool is selected initially. I'll go back and verify before merging though. I vaguely remember testing this when I first wrote the initial portion a month ago, but I'd like to see it Actually Work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it be possible to, if they're selected as an antag, just...make them spawn as a passenger? missing out on the job slot i want because i only queue command/sec but don't have antags disabled sounds rough. and as we've always discussed, more people might play sec if they could still get lucky and roll antag passenger as a surprise There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
the natural solution to this feels like just putting passenger on 'low' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh... oh my god you're right it's that easy. for 600 hours I've only set jobs as high or never. yay!! |
||
|
||
if (weight is not null && job.Weight != weight.Value) | ||
continue; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably be > 0 for sanity, even if it never intentionally goes negative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well yeah