(df244251c) Fixed: Electric devices that are underwater and are broken by flooding being repairable forever, due to condition never staying at full condition for long enough for the repairing to stop

This commit is contained in:
Joonas Rikkonen
2019-06-11 21:46:02 +03:00
parent 20d88b3769
commit dd1ce8bf2f
10 changed files with 79 additions and 155 deletions
@@ -478,45 +478,6 @@ namespace Barotrauma
return true;
};
}
public static void AddSelection(MapEntity entity)
{
if (selectedList.Contains(entity)) { return; }
selectedList.Add(entity);
if (entity is Item i)
{
var door = i.GetComponent<Door>();
if (door != null)
{
var gap = door.LinkedGap;
if (gap != null)
{
door.RefreshLinkedGap();
if (!selectedList.Contains(gap))
{
selectedList.Add(gap);
}
}
}
}
}
public static void RemoveSelection(MapEntity entity)
{
selectedList.Remove(entity);
if (entity is Item i)
{
var door = i.GetComponent<Door>();
if (door != null)
{
var gap = door.LinkedGap;
if (gap != null)
{
selectedList.Remove(gap);
}
}
}
}
static partial void UpdateAllProjSpecific(float deltaTime)
{
@@ -585,7 +546,6 @@ namespace Barotrauma
public static void UpdateEditor(Camera cam)
{
FilteredSelectedList.Clear();
if (highlightedListBox != null) highlightedListBox.UpdateManually((float)Timing.Step);
if (editingHUD != null)
@@ -603,16 +563,11 @@ namespace Barotrauma
}
if (selectedList.Count == 0) return;
foreach (var e in selectedList)
if (editingHUD != null)
{
if (e is Gap) { continue; }
FilteredSelectedList.Add(e);
}
var first = FilteredSelectedList.FirstOrDefault();
if (first != null)
{
first.UpdateEditing(cam);
if (first.ResizeHorizontal || first.ResizeVertical)
selectedList[0].UpdateEditing(cam);
if (selectedList[0].ResizeHorizontal || selectedList[0].ResizeVertical)
{
first.UpdateResizing(cam);
}