File tree 1 file changed +19
-11
lines changed
1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,8 @@ protected override void LoadDefaultConfig() {
41
41
42
42
void OnServerSave ( )
43
43
{
44
+ RemoveAllTempCodeLocks ( ) ;
44
45
data . Save ( ) ;
45
-
46
- // Remove all temp code locks - we don't want to save them.
47
- foreach ( TempCodeLockInfo codeLockInfo in tempCodeLocks . Values )
48
- {
49
- if ( ! codeLockInfo . CodeLock . IsDestroyed )
50
- {
51
- codeLockInfo . CodeLock . Kill ( ) ;
52
- }
53
- }
54
- tempCodeLocks . Clear ( ) ;
55
- UnsubscribeFromUnneedHooks ( ) ;
56
46
}
57
47
58
48
void OnServerShutdown ( )
@@ -62,6 +52,7 @@ void OnServerShutdown()
62
52
63
53
void Unload ( )
64
54
{
55
+ RemoveAllTempCodeLocks ( ) ;
65
56
data . Save ( ) ;
66
57
}
67
58
@@ -487,6 +478,23 @@ private void DestoryTempCodeLock(BasePlayer player)
487
478
UnsubscribeFromUnneedHooks ( ) ;
488
479
}
489
480
481
+ /// <summary>
482
+ /// Remove all the temporary code locks.
483
+ /// </summary>
484
+ private void RemoveAllTempCodeLocks ( )
485
+ {
486
+ // Remove all temp code locks - we don't want to save them.
487
+ foreach ( TempCodeLockInfo codeLockInfo in tempCodeLocks . Values )
488
+ {
489
+ if ( ! codeLockInfo . CodeLock . IsDestroyed )
490
+ {
491
+ codeLockInfo . CodeLock . Kill ( ) ;
492
+ }
493
+ }
494
+ tempCodeLocks . Clear ( ) ;
495
+ UnsubscribeFromUnneedHooks ( ) ;
496
+ }
497
+
490
498
/// <summary>
491
499
/// Unsubscribe from things that there is not point currently being subscribed to.
492
500
/// </summary>
You can’t perform that action at this time.
0 commit comments