Fixed missions not matching between Linux and Windows builds

This commit is contained in:
Regalis
2016-03-28 19:56:32 +03:00
parent c1a1990f08
commit 23f1623562
4 changed files with 5 additions and 17 deletions
+1 -1
View File
@@ -103,7 +103,7 @@
<Compile Include="Source\Events\ArtifactEvent.cs" /> <Compile Include="Source\Events\ArtifactEvent.cs" />
<Compile Include="Source\GameSession\CargoManager.cs" /> <Compile Include="Source\GameSession\CargoManager.cs" />
<Compile Include="Source\GameSession\GameModes\GameModePreset.cs" /> <Compile Include="Source\GameSession\GameModes\GameModePreset.cs" />
<Compile Include="Source\GameSession\GameModes\QuestMode.cs" /> <Compile Include="Source\GameSession\GameModes\MissionMode.cs" />
<Compile Include="Source\GameSession\GameModes\Tutorials\BasicTutorial.cs" /> <Compile Include="Source\GameSession\GameModes\Tutorials\BasicTutorial.cs" />
<Compile Include="Source\GameSession\GameModes\Tutorials\EditorTutorial.cs" /> <Compile Include="Source\GameSession\GameModes\Tutorials\EditorTutorial.cs" />
<Compile Include="Source\GameSession\GameModes\Tutorials\TutorialType.cs" /> <Compile Include="Source\GameSession\GameModes\Tutorials\TutorialType.cs" />
+1 -1
View File
@@ -57,7 +57,7 @@ namespace Barotrauma
private void CreateScriptedEvents(Level level) private void CreateScriptedEvents(Level level)
{ {
Random rand = new Random(ToolBox.StringToInt(level.Seed)); MTRandom rand = new MTRandom(ToolBox.StringToInt(level.Seed));
float totalDifficulty = level.Difficulty; float totalDifficulty = level.Difficulty;
@@ -1,14 +1,10 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Barotrauma namespace Barotrauma
{ {
class MissionMode : GameMode class MissionMode : GameMode
{ {
Mission mission; private Mission mission;
public override Mission Mission public override Mission Mission
{ {
@@ -23,7 +19,7 @@ namespace Barotrauma
{ {
Location[] locations = new Location[2]; Location[] locations = new Location[2];
Random rand = new Random(ToolBox.StringToInt(GameMain.NetLobbyScreen.LevelSeed)); MTRandom rand = new MTRandom(ToolBox.StringToInt(GameMain.NetLobbyScreen.LevelSeed));
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
@@ -41,14 +37,6 @@ namespace Barotrauma
Networking.GameServer.Log("Mission: " + mission.Name, Color.Cyan); Networking.GameServer.Log("Mission: " + mission.Name, Color.Cyan);
Networking.GameServer.Log(mission.Description, Color.Cyan); Networking.GameServer.Log(mission.Description, Color.Cyan);
//quest.Start(Level.Loaded);
}
public override void End(string endMessage = "")
{
//quest.End();
base.End(endMessage);
} }
} }
} }
+1 -1
View File
@@ -383,7 +383,7 @@ namespace Barotrauma
int seed = (int)locations[0].MapPosition.X + (int)locations[0].MapPosition.Y * 100; 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; seed += (int)locations[1].MapPosition.X*10000 + (int)locations[1].MapPosition.Y * 1000000;
Random rand = new Random(seed + missionsCompleted); MTRandom rand = new MTRandom(seed + missionsCompleted);
if (rand.NextDouble() < 0.3f) return null; if (rand.NextDouble() < 0.3f) return null;