Skip to content

Commit 82f9ede

Browse files
committed
Bump to version 1.0.5
-Fixed issue with list being modified during loop.
1 parent 54bb5d3 commit 82f9ede

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

ScubaTankConnector/Items/Equipment/OxygenLink.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void OnUnequip(GameObject sender, string slot)
9494
{
9595
Inventory.main.container.onAddItem -= OnItemAdded;
9696
Inventory.main.container.onRemoveItem -= OnItemRemoved;
97-
LinkedSources.ForEach(source => UnlinkOxygenSource(source));
97+
UnlinkAllSources();
9898
Plugin.Logger.LogDebug("OxygenLink Un-Equipped!");
9999
}
100100

@@ -128,6 +128,12 @@ public void UnlinkOxygenSource(Oxygen source)
128128
Player.main.oxygenMgr.UnregisterSource(source);
129129
}
130130

131+
public void UnlinkAllSources()
132+
{
133+
List<Oxygen> linkedSources = new List<Oxygen>(LinkedSources);
134+
linkedSources.ForEach(source => UnlinkOxygenSource(source));
135+
}
136+
131137
public void UpdateEquipped(GameObject sender, string slot)
132138
{
133139
}
@@ -157,7 +163,7 @@ private void OnDestroy()
157163
{
158164
Inventory.main.container.onAddItem -= OnItemAdded;
159165
Inventory.main.container.onRemoveItem -= OnItemRemoved;
160-
LinkedSources.ForEach(source => UnlinkOxygenSource(source));
166+
UnlinkAllSources();
161167
Plugin.Logger.LogDebug("OxygenLink Component Destroyed!");
162168
}
163169
}

ScubaTankConnector/Plugin.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public class Plugin : BaseUnityPlugin
1212
public const string
1313
GUID = $"{AUTHOR}.{NAME}",
1414
NAME = "OxygenLink",
15-
VERSION = "1.0.2",
16-
AUTHOR = "0xKate",
15+
VERSION = "1.0.5",
16+
AUTHOR = "KateMods",
1717
NEXUS = "Placeholder";
1818

1919
public new static ManualLogSource Logger { get; private set; }

0 commit comments

Comments
 (0)