Unstable 0.16.2.0

This commit is contained in:
Markus Isberg
2022-02-02 00:55:02 +09:00
parent b259af5911
commit 6814a11520
106 changed files with 1634 additions and 793 deletions
@@ -346,7 +346,12 @@ namespace Barotrauma
Vector2 limbDiff = attackSimPosition - mouthPos;
float extent = Math.Max(mouthLimb.body.GetMaxExtent(), 1);
if (limbDiff.LengthSquared() < extent * extent)
bool tooFar = character.InWater ? limbDiff.LengthSquared() > extent * extent : limbDiff.X > extent;
if (tooFar)
{
character.SelectedCharacter = null;
}
else
{
//pull the target character to the position of the mouth
//(+ make the force fluctuate to waggle the character a bit)
@@ -383,7 +388,7 @@ namespace Barotrauma
mouthLimb.body.ApplyTorque(-force * 50);
}
if (Character.CanEat)
if (Character.CanEat && target.IsDead)
{
var jaw = GetLimb(LimbType.Jaw);
if (jaw != null)
@@ -432,10 +437,6 @@ namespace Barotrauma
}
}
}
else
{
character.SelectedCharacter = null;
}
}
public bool reverse;