File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ public void OnUnequip(GameObject sender, string slot)
94
94
{
95
95
Inventory . main . container . onAddItem -= OnItemAdded ;
96
96
Inventory . main . container . onRemoveItem -= OnItemRemoved ;
97
- LinkedSources . ForEach ( source => UnlinkOxygenSource ( source ) ) ;
97
+ UnlinkAllSources ( ) ;
98
98
Plugin . Logger . LogDebug ( "OxygenLink Un-Equipped!" ) ;
99
99
}
100
100
@@ -128,6 +128,12 @@ public void UnlinkOxygenSource(Oxygen source)
128
128
Player . main . oxygenMgr . UnregisterSource ( source ) ;
129
129
}
130
130
131
+ public void UnlinkAllSources ( )
132
+ {
133
+ List < Oxygen > linkedSources = new List < Oxygen > ( LinkedSources ) ;
134
+ linkedSources . ForEach ( source => UnlinkOxygenSource ( source ) ) ;
135
+ }
136
+
131
137
public void UpdateEquipped ( GameObject sender , string slot )
132
138
{
133
139
}
@@ -157,7 +163,7 @@ private void OnDestroy()
157
163
{
158
164
Inventory . main . container . onAddItem -= OnItemAdded ;
159
165
Inventory . main . container . onRemoveItem -= OnItemRemoved ;
160
- LinkedSources . ForEach ( source => UnlinkOxygenSource ( source ) ) ;
166
+ UnlinkAllSources ( ) ;
161
167
Plugin . Logger . LogDebug ( "OxygenLink Component Destroyed!" ) ;
162
168
}
163
169
}
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ public class Plugin : BaseUnityPlugin
12
12
public const string
13
13
GUID = $ "{ AUTHOR } .{ NAME } ",
14
14
NAME = "OxygenLink" ,
15
- VERSION = "1.0.2 " ,
16
- AUTHOR = "0xKate " ,
15
+ VERSION = "1.0.5 " ,
16
+ AUTHOR = "KateMods " ,
17
17
NEXUS = "Placeholder" ;
18
18
19
19
public new static ManualLogSource Logger { get ; private set ; }
You can’t perform that action at this time.
0 commit comments