(0be4bd31d) Todo note about idling characters killing the framerate (see #1397)
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -1144,12 +1144,6 @@ namespace Barotrauma
|
||||
return;
|
||||
}
|
||||
|
||||
float forceFactor = 1.0f;
|
||||
if (CurrentHull != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
float forceFactor = 1.0f;
|
||||
if (CurrentHull != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user