Fixed round ending tickbox not being visible client-side if the client is not controlling character (despite servers now allowing votes from players who've spawned at least once during the round). Closes #500
This commit is contained in:
@@ -44,6 +44,9 @@ namespace Barotrauma.Networking
|
||||
|
||||
private FileReceiver fileReceiver;
|
||||
|
||||
//has the client been given a character to control this round
|
||||
public bool HasSpawned;
|
||||
|
||||
public byte ID
|
||||
{
|
||||
get { return myID; }
|
||||
@@ -480,7 +483,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
if (gameStarted && Screen.Selected == GameMain.GameScreen)
|
||||
{
|
||||
endVoteTickBox.Visible = Voting.AllowEndVoting && myCharacter != null;
|
||||
endVoteTickBox.Visible = Voting.AllowEndVoting && HasSpawned;
|
||||
|
||||
if (respawnManager != null)
|
||||
{
|
||||
@@ -666,6 +669,7 @@ namespace Barotrauma.Networking
|
||||
private IEnumerable<object> StartGame(NetIncomingMessage inc)
|
||||
{
|
||||
if (Character != null) Character.Remove();
|
||||
HasSpawned = false;
|
||||
|
||||
GameMain.LightManager.LightingEnabled = true;
|
||||
|
||||
@@ -1281,6 +1285,23 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
base.Draw(spriteBatch);
|
||||
|
||||
if (Screen.Selected == GameMain.GameScreen && !GUI.DisableHUD)
|
||||
{
|
||||
if (EndVoteCount > 0)
|
||||
{
|
||||
if (!HasSpawned)
|
||||
{
|
||||
GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 180.0f, 40),
|
||||
"Votes to end the round (y/n): " + EndVoteCount + "/" + (EndVoteMax - EndVoteCount), Color.White, null, 0, GUI.SmallFont);
|
||||
}
|
||||
else
|
||||
{
|
||||
GUI.DrawString(spriteBatch, new Vector2(GameMain.GraphicsWidth - 140.0f, 40),
|
||||
"Votes (y/n): " + EndVoteCount + "/" + (EndVoteMax - EndVoteCount), Color.White, null, 0, GUI.SmallFont);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fileReceiver != null && fileReceiver.ActiveTransfers.Count > 0)
|
||||
{
|
||||
Vector2 pos = new Vector2(GameMain.NetLobbyScreen.InfoFrame.Rect.X, GameMain.GraphicsHeight - 35);
|
||||
@@ -1564,14 +1585,13 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (!gameStarted) return false;
|
||||
|
||||
if (!Voting.AllowEndVoting || myCharacter==null)
|
||||
if (!Voting.AllowEndVoting || !HasSpawned)
|
||||
{
|
||||
tickBox.Visible = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
Vote(VoteType.EndRound, tickBox.Selected);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user