Server job assigning logic, submarine movement syncing, submarine collision improvements, spawnpoints in levels

This commit is contained in:
Regalis
2015-07-08 11:37:47 +03:00
parent 3af9b8183b
commit d56f7f3f77
155 changed files with 39772 additions and 261 deletions
+5 -3
View File
@@ -92,11 +92,13 @@ namespace Subsurface
}
public static ScriptedEvent LoadRandom()
public static ScriptedEvent LoadRandom(string seed)
{
XDocument doc = ToolBox.TryLoadXml(configFile);
if (doc == null) return null;
Random rand = new Random(seed.GetHashCode());
int eventCount = doc.Root.Elements().Count();
//int[] commonness = new int[eventCount];
float[] eventProbability = new float[eventCount];
@@ -123,9 +125,9 @@ namespace Subsurface
probabilitySum += eventProbability[i];
i++;
}
}
float randomNumber = Rand.Range(0.0f,probabilitySum);
float randomNumber = (float)rand.NextDouble() * probabilitySum;
i = 0;
foreach (XElement element in doc.Root.Elements())