Skip to content

Commit 1aff2fc

Browse files
committed
Fixed Lua ScriptCompiler constructor not calling SetupCompiler
1 parent 1999555 commit 1aff2fc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

sqfc.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ compiler:AddMacro(Macro.new("MY_MACRO_CUSTOM_ARGS", {"arg1", "arg2"},
9696
end
9797
));
9898

99-
print("Preprocessed Script: \n", compiler:PreprocessFile(path.new("P:/test.sqf")));
99+
-- print("Preprocessed Script: \n", compiler:PreprocessFile(path.new("P:\\test.sqf")));
100100

101101

102102
function optimizerNodeHandler(node)
@@ -163,5 +163,6 @@ end
163163
local optimizer = OptimizerModuleLua.new(optimizerNodeHandler)
164164

165165

166-
compiler:CompileScriptToFile(path.new("P:/test.sqf"), path.new("P:/test.asm"), optimizer)
166+
--compiler:CompileScriptToFile(path.new("P:\\test.sqf"), path.new("P:/test.asm"), optimizer)
167+
compiler:CompileScriptToFile(path.new("T:\\z\\ace\\addons\\common\\functions\\fnc_cbaSettings_loadFromConfig.sqf"), path.new("P:/test.asm"), optimizer)
167168

src/luaHandler.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,13 @@ LuaHandler::LuaHandler() {
219219

220220

221221
lua.new_usertype<ScriptCompiler>(
222-
"ScriptCompiler", sol::default_constructor,
222+
"ScriptCompiler", sol::no_constructor,
223+
"new", []()
224+
{
225+
ScriptCompiler compiler;
226+
GLuaHandler.SetupCompiler(compiler);
227+
return compiler;
228+
},
223229

224230
"InitIncludePaths", [](ScriptCompiler& comp, sol::table paths)
225231
{

0 commit comments

Comments
 (0)