Skip to content

Commit

Permalink
Lower sound spam detection threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurkehrwald authored and freezy committed Jan 12, 2025
1 parent abb9997 commit a134fc7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ public async Task Play(float volume = 1f)
return;
}
float timeSinceLastPlay = Time.unscaledTime - _lastPlayStartTime;
if (timeSinceLastPlay < 0.1f) {
Logger.Warn("Sound spam protection engaged. There is probably something wrong with the calling code.");
if (timeSinceLastPlay < 0.01f) {
Logger.Warn($"Sound spam protection engaged. Time since last play was less than " +
$"0.01 seconds ({timeSinceLastPlay}). There is probably something wrong with " +
$"the calling code.");
return;
}

Expand Down

0 comments on commit a134fc7

Please sign in to comment.