diff --git a/Barotrauma/BarotraumaShared/Source/Events/Missions/SalvageMission.cs b/Barotrauma/BarotraumaShared/Source/Events/Missions/SalvageMission.cs index 0d430ad10..5ae148b83 100644 --- a/Barotrauma/BarotraumaShared/Source/Events/Missions/SalvageMission.cs +++ b/Barotrauma/BarotraumaShared/Source/Events/Missions/SalvageMission.cs @@ -46,7 +46,9 @@ namespace Barotrauma public override void Start(Level level) { - Vector2 position = Level.Loaded.GetRandomItemPos(spawnPositionType, 100.0f, Level.Loaded.Size.X * 0.3f, 30.0f); + //ruin items are allowed to spawn close to the sub + float minDistance = spawnPositionType == Level.PositionType.Ruin ? 0.0f : Level.Loaded.Size.X * 0.3f; + Vector2 position = Level.Loaded.GetRandomItemPos(spawnPositionType, 100.0f, minDistance, 30.0f); item = new Item(itemPrefab, position, null); item.MoveWithLevel = true; diff --git a/Barotrauma/BarotraumaShared/Source/Events/MonsterEvent.cs b/Barotrauma/BarotraumaShared/Source/Events/MonsterEvent.cs index 9b6d2c34e..2fd6a7078 100644 --- a/Barotrauma/BarotraumaShared/Source/Events/MonsterEvent.cs +++ b/Barotrauma/BarotraumaShared/Source/Events/MonsterEvent.cs @@ -85,7 +85,8 @@ namespace Barotrauma if (disallowed) return null; Vector2 spawnPos; - if (!Level.Loaded.TryGetInterestingPosition(true, spawnPosType, 20000.0f, out spawnPos)) + float minDist = spawnPosType == Level.PositionType.Ruin ? 0.0f : 20000.0f; + if (!Level.Loaded.TryGetInterestingPosition(true, spawnPosType, minDist, out spawnPos)) { //no suitable position found, disable the event repeat = false;