(a4af8c68b) Don't try to open doors that are stuck.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:28:24 +03:00
parent b628abbf7d
commit 874bc07cfd
8 changed files with 107 additions and 303 deletions
@@ -398,17 +398,18 @@ namespace Barotrauma
}
}
if (door == null) return;
if (door == null) { return; }
//toggle the door if it's the previous node and open, or if it's current node and closed
if (door.IsOpen != shouldBeOpen)
{
var buttons = door.Item.GetComponents<Controller>();
if (buttons.None())
if (door.IsStuck && shouldBeOpen)
{
buttons = door.Item.GetConnectedComponents<Controller>(true);
currentPath.Unreachable = true;
return;
}
var buttons = door.Item.GetConnectedComponents<Controller>(true);
Controller closestButton = null;
float closestDist = 0.0f;