Restart vote does not vote no for AFK players.
This commit is contained in:
@@ -80,7 +80,7 @@ namespace Content.Server.Voting.Managers
|
|||||||
|
|
||||||
foreach (var player in _playerManager.GetAllPlayers())
|
foreach (var player in _playerManager.GetAllPlayers())
|
||||||
{
|
{
|
||||||
if (player != initiator)
|
if (player != initiator && !_afkManager.IsAfk(player))
|
||||||
{
|
{
|
||||||
// Everybody else defaults to a no vote.
|
// Everybody else defaults to a no vote.
|
||||||
vote.CastVote(player, 1);
|
vote.CastVote(player, 1);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Administration;
|
using Content.Server.Administration;
|
||||||
using Content.Server.Administration.Managers;
|
using Content.Server.Administration.Managers;
|
||||||
|
using Content.Server.Afk;
|
||||||
using Content.Server.Chat.Managers;
|
using Content.Server.Chat.Managers;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.Collections;
|
using Content.Shared.Collections;
|
||||||
@@ -32,6 +33,7 @@ namespace Content.Server.Voting.Managers
|
|||||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||||
[Dependency] private readonly IAdminManager _adminMgr = default!;
|
[Dependency] private readonly IAdminManager _adminMgr = default!;
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
|
[Dependency] private readonly IAfkManager _afkManager = default!;
|
||||||
|
|
||||||
private int _nextVoteId = 1;
|
private int _nextVoteId = 1;
|
||||||
|
|
||||||
|
|||||||
4
Resources/Changelog/Parts/restart_vote_afk.yml
Normal file
4
Resources/Changelog/Parts/restart_vote_afk.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: PJB
|
||||||
|
changes:
|
||||||
|
- type: Tweak
|
||||||
|
message: AFK players no longer automatically vote "no" on restart votes.
|
||||||
Reference in New Issue
Block a user