浏览代码

fix font cache attempting to start with char 0x0, time delay generation by one second per to mitigate ap choke

AzaezelX 2 年之前
父节点
当前提交
07b3cba378
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript

+ 8 - 1
Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript

@@ -654,14 +654,21 @@ function populateAllFonts()
    
    %fontarrayCount = %fontarray.count(); 
    
+   echo("Generating "@ %fontarrayCount @" fonts");
    for (%i=0;%i<%fontarrayCount;%i++)
    {
       %font = %fontarray.getKey(%i);
       %hieght =  %fontarray.getValue(%i);
-      populateFontCacheRange(%font,%hieght,0,65535);
+      schedule(1000*%i,0,"delayedFontsPopulation",%font, %hieght, %i+1);
    }
    %fontarray.delete();
 }
+function delayedFontsPopulation(%font, %hieght, %fontNum)
+{
+    echo("Font ["@ %fontNum @"] Generating "@ %font SPC %hieght);
+    populateFontCacheRange(%font,%hieght,1,65535);
+}
+
 //------------------------------------------------------------------------------
 function clientCMDPlaySound(%soundAssetId,%pos)
 {