v0.4.1.3:

- fixed debug message height not being set correctly
- fixed submarine list not being updated if host has enabled "play yourself"
- fixed "queue empty" error when attempting to download a sub from the server
- maximum number of iterations when carving a path for a cave
This commit is contained in:
Regalis
2016-05-27 14:41:34 +03:00
parent 68870b67f5
commit c71a935de6
8 changed files with 64 additions and 12 deletions
+1 -1
View File
@@ -606,7 +606,7 @@ namespace Barotrauma
try
{
var textBlock = new GUITextBlock(new Rectangle(0, 0, 0, 0), msg, GUI.Style, Alignment.TopLeft, Alignment.Left, null, true, GUI.SmallFont);
var textBlock = new GUITextBlock(new Rectangle(0, 0, listBox.Rect.Width, 0), msg, GUI.Style, Alignment.TopLeft, Alignment.Left, null, true, GUI.SmallFont);
textBlock.CanBeFocused = false;
textBlock.TextColor = color;
@@ -281,6 +281,8 @@ namespace Barotrauma
int currentTargetIndex = 1;
int iterationsLeft = cells.Count;
do
{
int edgeIndex = 0;
@@ -325,13 +327,15 @@ namespace Barotrauma
currentCell.CellType = CellType.Path;
pathCells.Add(currentCell);
iterationsLeft--;
if (currentCell == targetCells[currentTargetIndex])
{
currentTargetIndex += 1;
if (currentTargetIndex >= targetCells.Count) break;
}
} while (currentCell != targetCells[targetCells.Count - 1]);
} while (currentCell != targetCells[targetCells.Count - 1] && iterationsLeft > 0);
Debug.WriteLine("gettooclose: " + sw2.ElapsedMilliseconds + " ms");
+3 -3
View File
@@ -380,10 +380,10 @@ namespace Barotrauma
{
if (mission !=null && mission.Completed) missionsCompleted++;
int seed = (int)locations[0].MapPosition.X + (int)locations[0].MapPosition.Y * 100;
seed += (int)locations[1].MapPosition.X*10000 + (int)locations[1].MapPosition.Y * 1000000;
long seed = (long)locations[0].MapPosition.X + (long)locations[0].MapPosition.Y * 100;
seed += (long)locations[1].MapPosition.X*10000 + (long)locations[1].MapPosition.Y * 1000000;
MTRandom rand = new MTRandom(seed + missionsCompleted);
MTRandom rand = new MTRandom((int)((seed + missionsCompleted) % int.MaxValue));
if (rand.NextDouble() < 0.3f) return null;
+3 -4
View File
@@ -452,7 +452,7 @@ namespace Barotrauma.Networking
if (characterInfo != null)
{
outmsg.Write(characterInfo.Name);
outmsg.Write(-1);
outmsg.Write((byte)0);
}
var subs = GameMain.NetLobbyScreen.GetSubList();
@@ -474,8 +474,6 @@ namespace Barotrauma.Networking
//send the message to everyone except the client who just logged in
SendMessage(outmsg, NetDeliveryMethod.ReliableUnordered, inc.SenderConnection);
UpdateVoteStatus();
AddChatMessage(sender.name + " has joined the server", ChatMessageType.Server);
}
}
@@ -590,6 +588,7 @@ namespace Barotrauma.Networking
break;
case (byte)PacketTypes.RequestNetLobbyUpdate:
UpdateNetLobby(null, null);
UpdateVoteStatus();
break;
case (byte)PacketTypes.SpectateRequest:
if (gameStarted && allowSpectating)
@@ -1712,7 +1711,7 @@ namespace Barotrauma.Networking
foreach (Client c in clients)
{
int index = c.jobPreferences.FindIndex(jp => jp == job);
if (index == -1) index = 1000;
if (index == 0) index = 1000;
if (preferredClient == null || index < bestPreference)
{
bestPreference = index;
@@ -1058,6 +1058,15 @@ namespace Barotrauma
"Do you want to download the file from the server host?" :
"Do you want to download the file and cancel downloading ''" + GameMain.Client.ActiveFileTransferName + "''?";
if (GUIMessageBox.MessageBoxes.Count>0)
{
var currentMessageBox = GUIMessageBox.MessageBoxes.Peek();
if (currentMessageBox != null && currentMessageBox.UserData as string == subName)
{
return false;
}
}
var requestFileBox = new GUIMessageBox("Submarine not found!", errorMsg+downloadMsg, new string[] { "Yes", "No" }, 400, 300);
requestFileBox.Buttons[0].UserData = subName;
requestFileBox.Buttons[0].OnClicked += requestFileBox.Close;
+1 -1
View File
@@ -535,7 +535,7 @@ namespace Barotrauma.Sounds
}
catch
{
continue;
finished = true;
}
if (finished)