(3ac5065f5) Fixed: Rendering order for Bugreporter window, OK button position

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:42:41 +03:00
parent da693c20fa
commit 3a2310e547
52 changed files with 278 additions and 458 deletions
@@ -114,23 +114,11 @@ namespace Barotrauma
{
Vector2 currTargetSimPos = Vector2.Zero;
currTargetSimPos = Target.SimPosition;
// Take the sub position into account in the sim pos
if (character.Submarine == null && Target.Submarine != null)
{
//currTargetSimPos += Target.Submarine.SimPosition;
}
else if (character.Submarine != null && Target.Submarine == null)
//if character is inside the sub and target isn't, transform the position
if (character.Submarine != null && Target.Submarine == null)
{
currTargetSimPos -= character.Submarine.SimPosition;
}
else if (character.Submarine != Target.Submarine)
{
if (character.Submarine != null && Target.Submarine != null)
{
Vector2 diff = character.Submarine.SimPosition - Target.Submarine.SimPosition;
currTargetSimPos -= diff;
}
}
character.AIController.SteeringManager.SteeringSeek(currTargetSimPos);
if (getDivingGearIfNeeded)
{
@@ -159,6 +147,7 @@ namespace Barotrauma
// First check the distance
// Then the custom condition
// And finally check if can interact (heaviest)
if (repeat) { return false; }
if (isCompleted) { return true; }
if (Target == null)
{
@@ -166,16 +155,7 @@ namespace Barotrauma
return false;
}
bool closeEnough = Vector2.DistanceSquared(Target.WorldPosition, character.WorldPosition) < CloseEnough * CloseEnough;
if (repeat)
{
if (closeEnough)
{
character.AIController.SteeringManager.Reset();
character.AnimController.TargetDir = Target.WorldPosition.X > character.WorldPosition.X ? Direction.Right : Direction.Left;
}
return false;
}
else if (closeEnough)
if (closeEnough)
{
if (customCondition == null || customCondition())
{