Unstable 0.1300.0.8

This commit is contained in:
Markus Isberg
2021-04-09 15:07:09 +03:00
parent 538c3dbfc3
commit 29bd4d6f49
38 changed files with 162 additions and 76 deletions
@@ -1175,7 +1175,8 @@ namespace Barotrauma
subBody.SetPosition(subBody.Position + amount);
}
public static Submarine FindClosest(Vector2 worldPosition, bool ignoreOutposts = false, bool ignoreOutsideLevel = true, bool ignoreRespawnShuttle = false)
/// <param name="teamType">If has value, the sub must match the team type.</param>
public static Submarine FindClosest(Vector2 worldPosition, bool ignoreOutposts = false, bool ignoreOutsideLevel = true, bool ignoreRespawnShuttle = false, CharacterTeamType? teamType = null)
{
Submarine closest = null;
float closestDist = 0.0f;
@@ -1187,6 +1188,7 @@ namespace Barotrauma
{
if (sub == GameMain.NetworkMember?.RespawnManager?.RespawnShuttle) { continue; }
}
if (teamType.HasValue && sub.TeamID != teamType) { continue; }
float dist = Vector2.DistanceSquared(worldPosition, sub.WorldPosition);
if (closest == null || dist < closestDist)
{
@@ -1359,7 +1361,8 @@ namespace Barotrauma
if (me.Submarine != this) { continue; }
if (me is Item item)
{
item.SpawnedInOutpost = info.OutpostGenerationParams != null && !info.OutpostGenerationParams.AllowStealing;
item.SpawnedInOutpost = info.OutpostGenerationParams != null;
item.AllowStealing = info.OutpostGenerationParams?.AllowStealing ?? true;
if (item.GetComponent<Repairable>() != null && indestructible)
{
item.Indestructible = true;