v1.6.17.0 (Unto the Breach update)

This commit is contained in:
Regalis11
2024-10-22 17:29:04 +03:00
parent e74b3cdb17
commit 6e6c17e100
417 changed files with 17166 additions and 5870 deletions
@@ -178,12 +178,21 @@ namespace Barotrauma
{
float minDistance = level.Size.X * 0.2f;
bool allowAtStart = prefab.AllowAtStart;
bool allowAtEnd = prefab.AllowAtEnd;
if (GameMain.GameSession?.GameMode is PvPMode)
{
//in PvP mode, the object must be allowed at both the start and end to be placed at either end
//since the 2nd team starts at the end of the level, it'd be unfair to allow e.g. ballast flora to spawn at the end of the level but not the start
allowAtEnd = allowAtStart = allowAtEnd && allowAtStart;
}
suitableSpawnPositions.Add(prefab,
availableSpawnPositions.Where(sp =>
sp.SpawnPosTypes.Any(type => prefab.SpawnPos.HasFlag(type)) &&
sp.Length >= prefab.MinSurfaceWidth &&
(prefab.AllowAtStart || !level.IsCloseToStart(sp.GraphEdge.Center, minDistance)) &&
(prefab.AllowAtEnd || !level.IsCloseToEnd(sp.GraphEdge.Center, minDistance)) &&
(allowAtStart || !level.IsCloseToStart(sp.GraphEdge.Center, minDistance)) &&
(allowAtEnd || !level.IsCloseToEnd(sp.GraphEdge.Center, minDistance)) &&
(sp.Alignment == Alignment.Any || prefab.Alignment.HasFlag(sp.Alignment))).ToList());
spawnPositionWeights.Add(prefab,