From 9052782a6c8278c09e895ca9286132643d17b648 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 6 Aug 2018 11:22:50 +0300 Subject: [PATCH] Fixed index out of range exception when trying to determine outside collider position for a gap that's not connected to anything --- Barotrauma/BarotraumaShared/Source/Map/Gap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Map/Gap.cs b/Barotrauma/BarotraumaShared/Source/Map/Gap.cs index dc55ee578..e0e69ae50 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Gap.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Gap.cs @@ -523,7 +523,7 @@ namespace Barotrauma simPosition = null; normal = null; - if (IsRoomToRoom || Submarine == null || open <= 0.0f) return false; + if (IsRoomToRoom || Submarine == null || open <= 0.0f || linkedTo.Count == 0 || !(linkedTo[0] is Hull)) return false; if (outsideColliderRaycastTimer <= 0.0f) {