Build 0.21.1.0

This commit is contained in:
Markus Isberg
2023-01-13 18:10:35 +02:00
parent 2f7205fb4b
commit 697ec52120
155 changed files with 2423 additions and 1237 deletions
@@ -117,13 +117,13 @@ namespace Barotrauma
public void StopSubmarineVote(bool passed)
{
if (!(ActiveVote is SubmarineVote)) { return; }
if (ActiveVote is not SubmarineVote) { return; }
StopActiveVote(passed);
}
public void StopMoneyTransferVote(bool passed)
{
if (!(ActiveVote is TransferVote)) { return; }
if (ActiveVote is not TransferVote) { return; }
StopActiveVote(passed);
}
@@ -155,7 +155,7 @@ namespace Barotrauma
GameMain.Server.UpdateVoteStatus(checkActiveVote: false);
}
private void StartOrEnqueueVote(IVote vote)
private static void StartOrEnqueueVote(IVote vote)
{
if (ActiveVote == null)
{
@@ -198,9 +198,9 @@ namespace Barotrauma
ActiveVote.Timer += deltaTime;
if (ActiveVote.Timer >= GameMain.NetworkMember.ServerSettings.VoteTimeout)
var inGameClients = GameMain.Server.ConnectedClients.Where(c => c.InGame);
if (ActiveVote.Timer >= GameMain.NetworkMember.ServerSettings.VoteTimeout || inGameClients.Count() == 1)
{
var inGameClients = GameMain.Server.ConnectedClients.Where(c => c.InGame);
var eligibleClients = inGameClients.Where(c => c != ActiveVote.VoteStarter);
// Do not take unanswered into account for total
@@ -216,7 +216,7 @@ namespace Barotrauma
}
}
public void ResetVotes(IEnumerable<Client> connectedClients, bool resetKickVotes)
public static void ResetVotes(IEnumerable<Client> connectedClients, bool resetKickVotes)
{
foreach (Client client in connectedClients)
{
@@ -254,7 +254,14 @@ namespace Barotrauma
string modeIdentifier = inc.ReadString();
GameModePreset mode = GameModePreset.List.Find(gm => gm.Identifier == modeIdentifier);
if (mode == null || !mode.Votable) { break; }
var prevHighestVoted = HighestVoted<GameModePreset>(VoteType.Mode, GameMain.Server.ConnectedClients);
sender.SetVote(voteType, mode);
var newHighestVoted = HighestVoted<GameModePreset>(VoteType.Mode, GameMain.Server.ConnectedClients);
if (prevHighestVoted != newHighestVoted)
{
GameMain.NetLobbyScreen.SelectedModeIdentifier = mode.Identifier;
GameMain.NetLobbyScreen.LastUpdateID++;
}
break;
case VoteType.EndRound:
if (!sender.HasSpawned) { return; }