Fixed AIObjectiveGoto terminating if previous path was unreachable, BackGroundSpriteManager won't place a sprite if a suitable position isn't found, StatusEffect fire position fix, UI improvements, door convexhull fix, progress on Fabricators & Deconstructors, mapentities sorted by category in edit mode, item descriptions, TutorialMode refactoring to make it easier to add new types of tutorials

This commit is contained in:
Regalis
2015-12-28 13:21:24 +02:00
parent 8c032d8368
commit 92d396e6b2
69 changed files with 1264 additions and 455 deletions

View File

@@ -22,7 +22,14 @@ namespace Barotrauma
{
if (repeat) return true;
var pathSteering = character.AIController.SteeringManager as IndoorsSteeringManager;
return (pathSteering.CurrentPath == null || !pathSteering.CurrentPath.Unreachable);
//path doesn't exist (= hasn't been searched for yet), assume for now that the target is reachable
if (pathSteering.CurrentPath == null) return true;
//steeringmanager is still targeting some other position, assume for now that the target is reachable
if ((target != null && Vector2.Distance(target.Position, targetPos) > 5.0f) ||
Vector2.Distance(pathSteering.CurrentTarget, targetPos) > 5.0f) return true;
return (!pathSteering.CurrentPath.Unreachable);
}
}