From bff2852cb651983698d3415c20d055ad5abd1741 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 21 Sep 2018 14:03:49 +0300 Subject: [PATCH] Fixed submarine waypoints getting mirrored in mirrored levels (cherry-picked from c785732) --- Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs b/Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs index 3ab2f1fe5..ec25608db 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Levels/Level.cs @@ -479,6 +479,7 @@ namespace Barotrauma foreach (WayPoint waypoint in WayPoint.WayPointList) { + if (waypoint.Submarine != null) continue; waypoint.Move(new Vector2((borders.Width / 2 - waypoint.Position.X) * 2, 0.0f)); } @@ -592,7 +593,7 @@ namespace Barotrauma { if (wp.SpawnType != SpawnType.Path) continue; - float dist =Math.Abs(cell.Center.X - wp.WorldPosition.X); + float dist = Math.Abs(cell.Center.X - wp.WorldPosition.X); if (closestWayPoint == null || dist < closestDist) { closestDist = dist;