(b8f75ee96) Fixed level inequality errors caused by 866621c. Accessing the level start/end location properties during level generation caused the seed of RandSync.Server to be changed. Now generating a new random location uses a new MTRandom instance and doesn't touch RandSync.Server.
This commit is contained in:
@@ -1519,14 +1519,6 @@ namespace Barotrauma
|
||||
string outpostFile = outpostFiles.GetRandom(Rand.RandSync.Server);
|
||||
var outpost = new Submarine(outpostFile, tryLoad: false);
|
||||
outpost.Load(unloadPrevious: false);
|
||||
if (i == 0)
|
||||
{
|
||||
if (GameMain.GameSession?.StartLocation != null) { outpost.Name = GameMain.GameSession.StartLocation.Name; }
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameMain.GameSession?.EndLocation != null) { outpost.Name = GameMain.GameSession.EndLocation.Name; }
|
||||
}
|
||||
outpost.MakeOutpost();
|
||||
|
||||
Point? minSize = null;
|
||||
@@ -1567,10 +1559,12 @@ namespace Barotrauma
|
||||
if ((i == 0) == !Mirrored)
|
||||
{
|
||||
StartOutpost = outpost;
|
||||
if (GameMain.GameSession?.StartLocation != null) { outpost.Name = GameMain.GameSession.StartLocation.Name; }
|
||||
}
|
||||
else
|
||||
{
|
||||
EndOutpost = outpost;
|
||||
if (GameMain.GameSession?.EndLocation != null) { outpost.Name = GameMain.GameSession.EndLocation.Name; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user