Artifacts and monsters are allowed to spawn close to the sub if they spawn inside ruins. Fixes "could not find a suitable position" errors in levels where there's only one ruin next to the spawnpos of the sub.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user