(6e187d247) Fixed contained items' status effects being added twice to the list of an ItemContainer's active status effects when swapping items. For example, when swapping a fuel rod with another one, the status effect that increases AvailableFuel would be applied twice, causing the reactor to act as if there were 2 rods in it. Closes #1643 + merge fix
This commit is contained in:
@@ -148,7 +148,14 @@ namespace Barotrauma
|
||||
//find the parent GUIListBox highest in the hierarchy
|
||||
for (int i = parentHierarchy.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (parentHierarchy[i].GUIComponent is GUIListBox) return parentHierarchy[i];
|
||||
if (parentHierarchy[i].GUIComponent is GUIListBox)
|
||||
{
|
||||
if (parentHierarchy[i].Parent != null && parentHierarchy[i].Parent.GUIComponent != null)
|
||||
{
|
||||
return parentHierarchy[i].Parent;
|
||||
}
|
||||
return parentHierarchy[i];
|
||||
}
|
||||
}
|
||||
//or just go with the direct parent if there are no listboxes in the hierarchy
|
||||
parentHierarchy.Clear();
|
||||
|
||||
Reference in New Issue
Block a user