(63916eda9) Unstable v0.9.1001.0

This commit is contained in:
Juan Pablo Arce
2020-05-15 13:06:19 -03:00
parent a1ca41aa5d
commit 3d2b7bcf63
52 changed files with 364 additions and 164 deletions
@@ -1600,6 +1600,7 @@ namespace Barotrauma
int attemptsLeft = maxAttempts;
bool success = false;
Vector2 spawnPoint = Vector2.Zero;
var allCells = Loaded.GetAllCells();
while (attemptsLeft > 0)
{
if (attemptsLeft < maxAttempts)
@@ -1847,8 +1848,7 @@ namespace Barotrauma
{
return true;
}
var cells = Loaded.GetAllCells().Where(c => c.Body != null && Vector2.DistanceSquared(pos, c.Center) <= maxDistance);
return cells.Any(c => c.BodyVertices.Any(v => bounds.ContainsWorld(v)));
return cells.Any(c => c.Body != null && Vector2.DistanceSquared(pos, c.Center) <= maxDistance && c.BodyVertices.Any(v => bounds.ContainsWorld(v)));
}
}
totalSW.Stop();