Unstable 0.1400.0.0

This commit is contained in:
Markus Isberg
2021-05-11 15:47:47 +03:00
parent 3f324b14e8
commit 92f0264af2
247 changed files with 8238 additions and 1911 deletions
@@ -668,9 +668,10 @@ namespace Barotrauma
return true;
}
public void GetNearbyTargets(Vector2 worldPosition, List<ISerializableEntity> targets)
public IEnumerable<ISerializableEntity> GetNearbyTargets(Vector2 worldPosition, List<ISerializableEntity> targets = null)
{
if (Range <= 0.0f) { return; }
targets ??= new List<ISerializableEntity>();
if (Range <= 0.0f) { return targets; }
if (HasTargetType(TargetType.NearbyCharacters))
{
foreach (Character c in Character.CharacterList)
@@ -707,6 +708,7 @@ namespace Barotrauma
}
}
}
return targets;
bool CheckDistance(ISpatialEntity e)
{
@@ -1235,6 +1237,12 @@ namespace Barotrauma
Projectile projectile = newItem.GetComponent<Projectile>();
if (projectile != null && user != null && sourceBody != null && entity != null)
{
var rope = newItem.GetComponent<Rope>();
if (rope != null && sourceBody.UserData is Limb sourceLimb)
{
rope.Attach(sourceLimb, newItem);
}
float spread = MathHelper.ToRadians(Rand.Range(-itemSpawnInfo.AimSpread, itemSpawnInfo.AimSpread));
var worldPos = sourceBody.Position;
float rotation = itemSpawnInfo.Rotation;