-- This loop loads and executes scripts one by one.

-- Enable the optimizer for luajit
package.path=package.path..";data\\scripts\\?.luac"..";data\\scripts\\?.lua";
-- require("jit.opt").start();
-- require("jit.trace");
-- jit.on();

repeat
	local aStr = gDataManager:GetNextScriptId();
	-- Skip the Boot script, as we are already in it, This script is the boot script!
	local aFound = string.find(aStr, "BOOT");
	if not aFound and #aStr ~= 0 then
		IcPrintLog(string.format("Executing: %s\n", aStr));
		-- gTable is used in the scripts to create appropriate tables
		gTable = aStr;
		local aScript = gDataManager:GetScript(aStr);
		assert(loadstring(aScript))()
	end
until #aStr == 0


IcPrintLog("*----------- END LUA INIT ------------*\n");
