Skip to content

Commit ccca1ab

Browse files
authored
Update Speaker.cs
1 parent 49df481 commit ccca1ab

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

EXILED/Exiled.API/Features/Toys/Speaker.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ public bool IsPaused
147147
if (!playBackRoutine.IsRunning)
148148
return;
149149

150+
if (playBackRoutine.IsAliveAndPaused == value)
151+
return;
152+
150153
playBackRoutine.IsAliveAndPaused = value;
151154
if (value)
152155
OnPlaybackPaused?.Invoke();
@@ -447,14 +450,12 @@ private void OnToyRemoved(AdminToyBase toy)
447450

448451
AdminToyBase.OnRemoved -= OnToyRemoved;
449452

450-
if (!isPlayBackInitialized)
451-
return;
452-
453453
Stop();
454454
encoder?.Dispose();
455455
encoder = null;
456456
frame = null;
457457
encoded = null;
458+
458459
isPlayBackInitialized = false;
459460
}
460461
}

0 commit comments

Comments
 (0)