Unstable v0.1100.0.4 (November 11th 2020)

This commit is contained in:
Joonas Rikkonen
2020-11-06 20:12:15 +02:00
parent 6b36bf809d
commit b772654326
297 changed files with 12502 additions and 4277 deletions
@@ -30,6 +30,8 @@ namespace Barotrauma
public bool followControlledCharacter;
public bool mimic;
public float extraDistanceWhileSwimming;
public float extraDistanceOutsideSub;
private float _closeEnough = 50;
private readonly float minDistance = 50;
/// <summary>
@@ -37,7 +39,19 @@ namespace Barotrauma
/// </summary>
public float CloseEnough
{
get { return _closeEnough; }
get
{
float dist = _closeEnough;
if (character.AnimController.InWater)
{
dist += extraDistanceWhileSwimming;
}
if (character.CurrentHull == null)
{
dist += extraDistanceOutsideSub;
}
return dist;
}
set
{
_closeEnough = Math.Max(minDistance, value);
@@ -324,13 +338,15 @@ namespace Barotrauma
Func<PathNode, bool> nodeFilter = null;
if (isInside && !AllowGoingOutside)
{
nodeFilter = node => node.Waypoint.CurrentHull != null;
nodeFilter = n => n.Waypoint.CurrentHull != null;
}
PathSteering.SteeringSeek(character.GetRelativeSimPosition(Target), 1, n =>
{
if (n.Waypoint.isObstructed) { return false; }
return (n.Waypoint.CurrentHull == null) == (character.CurrentHull == null);
}, endNodeFilter, nodeFilter, CheckVisibility);
PathSteering.SteeringSeek(character.GetRelativeSimPosition(Target), 1,
startNodeFilter: n => (n.Waypoint.CurrentHull == null) == (character.CurrentHull == null),
endNodeFilter,
nodeFilter,
CheckVisibility);
if (!isInside && PathSteering.CurrentPath == null || PathSteering.IsPathDirty || PathSteering.CurrentPath.Unreachable)
{
if (useScooter)