(a410fd46c) Trying to help the merge script through a jungle of merges

This commit is contained in:
Joonas Rikkonen
2019-06-04 16:19:53 +03:00
parent 5208b922d8
commit bea7b58ff3
84 changed files with 1720 additions and 929 deletions
@@ -215,11 +215,12 @@ namespace Barotrauma
protected virtual void OnCompleted()
{
if (Completed != null)
{
Completed();
Completed = null;
}
Completed?.Invoke();
//if (Completed != null)
//{
// Completed();
// Completed = null;
//}
}
public virtual void Reset() { }
@@ -181,8 +181,7 @@ namespace Barotrauma
{
if (closeEnough)
{
character.AIController.SteeringManager.Reset();
character.AnimController.TargetDir = Target.WorldPosition.X > character.WorldPosition.X ? Direction.Right : Direction.Left;
OnCompleted();
}
return false;
}
@@ -204,11 +203,6 @@ namespace Barotrauma
}
}
}
if (isCompleted)
{
character.AIController.SteeringManager.Reset();
character.AnimController.TargetDir = Target.WorldPosition.X > character.WorldPosition.X ? Direction.Right : Direction.Left;
}
return isCompleted;
}
@@ -223,5 +217,15 @@ namespace Barotrauma
float interactionDistance = Target is Item i ? i.InteractDistance * 0.9f : 0;
CloseEnough = Math.Max(interactionDistance, CloseEnough);
}
protected override void OnCompleted()
{
character.AIController.SteeringManager.Reset();
if (Target != null)
{
character.AnimController.TargetDir = Target.WorldPosition.X > character.WorldPosition.X ? Direction.Right : Direction.Left;
}
base.OnCompleted();
}
}
}
@@ -156,7 +156,7 @@ namespace Barotrauma
bool isRoomNameFound = currentTarget.DisplayName != null;
errorMsg = "(Character " + character.Name + " idling, target " + (isRoomNameFound ? currentTarget.DisplayName : currentTarget.ToString()) + ")";
#endif
var path = PathSteering.PathFinder.FindPath(character.SimPosition, currentTarget.SimPosition, errorMsg);
var path = PathSteering.PathFinder.FindPath(character.SimPosition, currentTarget.SimPosition, errorMsgStr: errorMsg);
PathSteering.SetPath(path);
}