gravydevsupreme 7 rokov pred
rodič
commit
2d02719748

+ 7 - 7
src/XUnity.AutoTranslator.Plugin.Core/Web/AutoTranslateClient.cs

@@ -50,22 +50,22 @@ namespace XUnity.AutoTranslator.Plugin.Core.Web
             yield return www;
             _runningTranslations--;
 
+            _translationCount++;
             if( Settings.MaxConcurrentTranslations == Settings.DefaultMaxConcurrentTranslations )
             {
-               _translationCount++;
                if( _translationCount > Settings.MaxTranslationsBeforeSlowdown )
                {
                   Settings.MaxConcurrentTranslations = 1;
                   Console.WriteLine( "[XUnity.AutoTranslator][WARN]: Maximum translations per session reached. Entering slowdown mode." );
                }
+            }
 
-               if( !Settings.IsShutdown )
+            if( !Settings.IsShutdown )
+            {
+               if( _translationCount > Settings.MaxTranslationsBeforeShutdown )
                {
-                  if( _translationCount > Settings.MaxTranslationsBeforeShutdown )
-                  {
-                     Settings.IsShutdown = true;
-                     Console.WriteLine( "[XUnity.AutoTranslator][ERROR]: Maximum translations per session reached. Shutting plugin down." );
-                  }
+                  Settings.IsShutdown = true;
+                  Console.WriteLine( "[XUnity.AutoTranslator][ERROR]: Maximum translations per session reached. Shutting plugin down." );
                }
             }