Fixed MP round summary always showing the game over text if the sub didn't progress to the next location. Closes #314

This commit is contained in:
Joonas Rikkonen
2018-03-06 17:26:43 +02:00
parent 10ce4bd20d
commit dd701e981e
@@ -38,8 +38,6 @@ namespace Barotrauma
if (!singleplayer) if (!singleplayer)
{ {
//Game over if everyone dead or didn't progress
gameOver = gameOver || !progress;
SoundPlayer.OverrideMusicType = gameOver ? "crewdead" : "endround"; SoundPlayer.OverrideMusicType = gameOver ? "crewdead" : "endround";
} }
@@ -50,13 +48,13 @@ namespace Barotrauma
.Replace("[sub]", Submarine.MainSub.Name) .Replace("[sub]", Submarine.MainSub.Name)
.Replace("[location]", progress ? GameMain.GameSession.EndLocation.Name : GameMain.GameSession.StartLocation.Name); .Replace("[location]", progress ? GameMain.GameSession.EndLocation.Name : GameMain.GameSession.StartLocation.Name);
var infoText = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width-20, 0), summaryText, "", null, true); var infoText = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width - 20, 0), summaryText, "", null, true);
infoText.Rect = new Rectangle(0, 0, infoText.Rect.Width, infoText.Rect.Height + 20); infoText.Rect = new Rectangle(0, 0, infoText.Rect.Width, infoText.Rect.Height + 20);
listBox.AddChild(infoText); listBox.AddChild(infoText);
if (!string.IsNullOrWhiteSpace(endMessage)) if (!string.IsNullOrWhiteSpace(endMessage))
{ {
var endText = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width-20, 0), endMessage, "", null, true); var endText = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width - 20, 0), endMessage, "", null, true);
endText.Rect = new Rectangle(0, 0, endText.Rect.Width, endText.Rect.Height + 20); endText.Rect = new Rectangle(0, 0, endText.Rect.Width, endText.Rect.Height + 20);
listBox.AddChild(endText); listBox.AddChild(endText);
} }