Autopilot can avoid other subs, characters won't go outside in idle state

This commit is contained in:
Regalis
2016-07-28 21:45:35 +03:00
parent 357a853342
commit c773320a55
6 changed files with 38 additions and 21 deletions
@@ -112,7 +112,7 @@ namespace Barotrauma
{
indoorsSteering.SteeringWander();
}
else if (getDivingGearIfNeeded && indoorsSteering.CurrentPath != null && indoorsSteering.HasOutdoorsNodes)
else if (getDivingGearIfNeeded && indoorsSteering.CurrentPath != null && indoorsSteering.CurrentPath.HasOutdoorsNodes)
{
AddSubObjective(new AIObjectiveFindDivingGear(character, true));
}
@@ -54,9 +54,12 @@ namespace Barotrauma
newTargetTimer -= deltaTime;
//wander randomly if reached the end of the path or the target is unreachable
//wander randomly
// - if reached the end of the path
// - if the target is unreachable
// - if the path requires going outside
if (pathSteering==null || (pathSteering.CurrentPath != null &&
(pathSteering.CurrentPath.NextNode == null || pathSteering.CurrentPath.Unreachable)))
(pathSteering.CurrentPath.NextNode == null || pathSteering.CurrentPath.Unreachable || pathSteering.CurrentPath.HasOutdoorsNodes)))
{
//steer away from edges of the hull
if (character.AnimController.CurrentHull!=null)