Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
1.4.2 Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Arion-Kun authored and Arion-Kun committed Feb 28, 2021
1 parent e7d061e commit 05b20e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal static class AssemblyInfo
{
internal const string Name = "MicSensitivity";

internal const string Version = "1.4.1";
internal const string Version = "1.4.2";

internal const string Description = "";

Expand Down
5 changes: 3 additions & 2 deletions Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using VRC.Core;
using static Dawn.Mic.MicSensitivity;


namespace Dawn
{
internal static class Core
Expand Down Expand Up @@ -55,17 +56,17 @@ internal static float userVolumePeak
}
}
}
internal static bool isInstantiated => CurrentUser != null && IsInWorld && uInstance != null;
internal static IEnumerator WorldJoinedCoroutine()
{
for (;;)
{
var sw = new Stopwatch();
sw.Start();
if (CurrentUser != null && IsInWorld)
if (isInstantiated) // 1 Extra check for the rare case scenario that uInstance is not set up fast enough from CurrentUser -> uInstance.
{
yield return new WaitForSeconds(1);
{
if (uInstance == null) yield return new WaitForSeconds(1); // 1 Extra check for the rare case scenario that uInstance is not set up fast enough from CurrentUser -> uInstance.
SensitivitySetup();
}
sw.Stop();
Expand Down
7 changes: 4 additions & 3 deletions MicSensitivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public override void OnPreferencesSaved()
internal static void SensitivitySetup()
{
if (!UseMod) return;
userVolumeThreshold = SensitivityValue; userVolumePeak = (SensitivityValue * 2); }
#endregion
if (!isInstantiated) return;
userVolumeThreshold = SensitivityValue; userVolumePeak = SensitivityValue * 2;
}

#endregion
}
}

0 comments on commit 05b20e8

Please sign in to comment.