Faction Test 100.5.0.0

This commit is contained in:
Markus Isberg
2022-11-18 18:32:04 +02:00
parent c772b61fc1
commit c44fb0ad3a
118 changed files with 1424 additions and 707 deletions
@@ -3961,10 +3961,9 @@ namespace Barotrauma
Submarine outpost = null;
if (i == 0 && preSelectedStartOutpost == null || i == 1 && preSelectedEndOutpost == null)
{
if (OutpostGenerationParams.OutpostParams.Any() || LevelData.ForceOutpostGenerationParams != null)
if (LevelData.OutpostGenerationParamsExist)
{
Location location = i == 0 ? StartLocation : EndLocation;
OutpostGenerationParams outpostGenerationParams = null;
if (LevelData.ForceOutpostGenerationParams != null)
{
@@ -3972,22 +3971,9 @@ namespace Barotrauma
}
else
{
var suitableParams = OutpostGenerationParams.OutpostParams
.Where(p => p.LevelType == null || LevelData.Type == p.LevelType)
.Where(p => location == null || p.AllowedLocationTypes.Contains(location.Type.Identifier));
if (!suitableParams.Any())
{
suitableParams = OutpostGenerationParams.OutpostParams
.Where(p => p.LevelType == null || LevelData.Type == p.LevelType)
.Where(p => location == null || !p.AllowedLocationTypes.Any());
if (!suitableParams.Any())
{
DebugConsole.ThrowError($"No suitable outpost generation parameters found for the location type \"{location.Type.Identifier}\". Selecting random parameters.");
suitableParams = OutpostGenerationParams.OutpostParams;
}
}
outpostGenerationParams = suitableParams.GetRandom(Rand.RandSync.ServerAndClient);
outpostGenerationParams =
LevelData.ForceOutpostGenerationParams ??
LevelData.GetSuitableOutpostGenerationParams(location, LevelData).GetRandom(Rand.RandSync.ServerAndClient);
}
LocationType locationType = location?.Type;