(2e0e45e1f) Updated: Localization

This commit is contained in:
Joonas Rikkonen
2019-05-20 20:41:52 +03:00
parent 5e77ed6507
commit b71adc7589
48 changed files with 389 additions and 587 deletions
@@ -164,15 +164,7 @@ namespace Barotrauma
}
var newPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")");
bool useNewPath = currentPath == null || needsNewPath;
if (!useNewPath && currentPath != null && currentPath.CurrentNode != null && newPath.Nodes.Any() && !newPath.Unreachable)
{
// It's possible that the current path was calculated from a start point that is no longer valid.
// Therefore, let's accept also paths with a greater cost than the current, if the current node is much farther than the new start node.
useNewPath = newPath.Cost < currentPath.Cost ||
Vector2.DistanceSquared(character.WorldPosition, currentPath.CurrentNode.WorldPosition) > Math.Pow(Vector2.Distance(character.WorldPosition, newPath.Nodes.First().WorldPosition) * 2, 2);
}
if (useNewPath)
if (currentPath == null || needsNewPath || !newPath.Unreachable && newPath.Cost < currentPath.Cost)
{
currentPath = newPath;
}
@@ -414,7 +406,7 @@ namespace Barotrauma
{
if (door.HasIntegratedButtons)
{
door.Item.TryInteract(character, false, true);
door.Item.TryInteract(character, false, true, true);
buttonPressCooldown = ButtonPressInterval;
break;
}
@@ -422,7 +414,7 @@ namespace Barotrauma
{
if (Vector2.DistanceSquared(closestButton.Item.WorldPosition, character.WorldPosition) < MathUtils.Pow(closestButton.Item.InteractDistance * 2, 2))
{
closestButton.Item.TryInteract(character, false, true);
closestButton.Item.TryInteract(character, false, true, false);
buttonPressCooldown = ButtonPressInterval;
break;
}