(0be4bd31d) Todo note about idling characters killing the framerate (see #1397)

This commit is contained in:
Joonas Rikkonen
2019-04-07 13:41:07 +03:00
parent db754188ce
commit 1297127ae2
2 changed files with 2 additions and 6 deletions

View File

@@ -207,6 +207,8 @@ namespace Barotrauma
{
// Check that there is no unsafe or forbidden hulls on the way to the target
// Only do this when the current hull is ok, because otherwise the would block all paths from the current hull to the target hull.
//TODO: optimize this (only attempt to find a couple of paths per frame?). Now idle characters completely kill the fps if they can't find a path (e.g. if they're in a room with no way out or if the sub is missing waypoints)
var path = PathSteering.PathFinder.FindPath(character.SimPosition, hull.SimPosition);
if (path.Unreachable) { continue; }
if (path.Nodes.Any(n => HumanAIController.UnsafeHulls.Contains(n.CurrentHull) || IsForbidden(n.CurrentHull))) { continue; }

View File

@@ -1144,12 +1144,6 @@ namespace Barotrauma
return;
}
float forceFactor = 1.0f;
if (CurrentHull != null)
{
return;
}
float forceFactor = 1.0f;
if (CurrentHull != null)
{