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
@@ -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;