(33abbb810) Fixed: Interfaces that were too small on 4k by removing the use of maxsize & adding scale related multipliers to absolute values

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:24:54 +03:00
parent 73bfd8d4a4
commit 75b88e0c18
18 changed files with 106 additions and 85 deletions
@@ -146,7 +146,7 @@ namespace Barotrauma
{
bool isDifferentTarget = Vector2.DistanceSquared(target, currentTarget) > 1;
//find a new path if one hasn't been found yet or the target is different from the current target
if (currentPath == null || isDifferentTarget || findPathTimer < -1.0f)
if (currentPath == null || Vector2.DistanceSquared(target, currentTarget) > 1.0f || findPathTimer < -1.0f)
{
IsPathDirty = true;
@@ -163,11 +163,7 @@ namespace Barotrauma
}
}
var newPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")");
if (currentPath == null || isDifferentTarget || newPath.Cost < currentPath.Cost)
{
currentPath = newPath;
}
currentPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")");
findPathTimer = Rand.Range(1.0f, 1.2f);
@@ -175,7 +175,7 @@ namespace Barotrauma
{
if (character.CanInteractWith(item, out _, checkLinked: false)) { isCompleted = true; }
}
else if (Target is Character targetCharacter && !FollowControlledCharacter)
else if (Target is Character targetCharacter)
{
if (character.CanInteractWith(targetCharacter, CloseEnough)) { isCompleted = true; }
}
@@ -230,6 +230,13 @@ namespace Barotrauma
//if searching for a path inside the sub, make sure the waypoint is visible
if (insideSubmarine)
{
// Doesn't seem to work
//var body = Submarine.CheckVisibility(end, node.Waypoint.SimPosition);
//if (body != null && body.UserData is Structure)
//{
// continue;
//}
var body = Submarine.PickBody(end, node.Waypoint.SimPosition, null,
Physics.CollisionWall | Physics.CollisionLevel | Physics.CollisionStairs );