(96ccafd88) Fix the goto objective not always completing because of too high NearEnough value.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:11:17 +03:00
parent 9a1e7f8212
commit 759e4aee0d
12 changed files with 133 additions and 60 deletions
@@ -1092,6 +1092,8 @@ namespace Barotrauma
private bool IsProperlyLatchedOnSub => LatchOntoAI != null && LatchOntoAI.IsAttachedToSub && SelectedAiTarget?.Entity == wallTarget?.Structure;
private bool IsProperlyLatchedOnSub => LatchOntoAI != null && LatchOntoAI.IsAttachedToSub && SelectedAiTarget?.Entity == wallTarget?.Structure;
//goes through all the AItargets, evaluates how preferable it is to attack the target,
//whether the Character can see/hear the target and chooses the most preferable target within
//sight/hearing range
@@ -186,7 +186,7 @@ namespace Barotrauma
public override bool IsCompleted()
{
if (repeat) return false;
if (repeat) { return false; }
bool completed = false;
@@ -218,7 +218,7 @@ namespace Barotrauma
private void CalculateCloseEnough()
{
float interactionDistance = Target is Item i ? ConvertUnits.ToSimUnits(i.InteractDistance) : 0;
float interactionDistance = Target is Item i ? ConvertUnits.ToSimUnits(i.InteractDistance * 0.9f) : 0;
CloseEnough = Math.Max(interactionDistance, CloseEnough);
}
}
@@ -2682,6 +2682,10 @@ namespace Barotrauma
GameMain.GameSession?.CrewManager?.RemoveCharacter(this);
#endif
#if CLIENT
GameMain.GameSession?.CrewManager?.RemoveCharacter(this);
#endif
#if CLIENT
GameMain.GameSession?.CrewManager?.RemoveCharacter(this);
#endif