Skip to content

Commit

Permalink
Fix 2.14 crash
Browse files Browse the repository at this point in the history
  • Loading branch information
dedmen committed Oct 22, 2023
1 parent 8e4bb6f commit 561a490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scriptProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1418,15 +1418,15 @@ void scriptProfiler::preStart() {
static auto _profilerSetCounter = client::host::register_sqf_command("profilerSetCounter", "Set's a counter value", profilerSetCounter, game_data_type::NOTHING, game_data_type::STRING, game_data_type::SCALAR);
static auto _profilerTime = client::host::register_sqf_command("profilerTime", "Returns the time since gamestart as [seconds, microseconds, nanoseconds]"sv, profilerTime, game_data_type::ARRAY);

compileFinal214 = (unary_function)host::functions.get_unary_function_typed("compilefinal"sv, "ANY"sv); //#TODO get rid at 2.14 release
compileFinal214 = (unary_function)host::functions.get_unary_function_typed("compilefinal"sv, "CODE"sv); //#TODO get rid at 2.14 release

auto compHookDisabled = client::host::request_plugin_interface("ProfilerNoCompile", 1); //ASM will call us via interface instead

if (!compHookDisabled && !getCommandLineParam("-profilerNoInstrumentation"sv)) {
static auto _profilerCompile = client::host::register_sqf_command("compile", "Profiler redirect", compileRedirect2, game_data_type::CODE, game_data_type::STRING);
//static auto _profilerCompile2 = client::host::register_sqf_command("compile2", "Profiler redirect", compileRedirect, game_data_type::CODE, game_data_type::STRING);
//static auto _profilerCompile3 = client::host::register_sqf_command("compile3", "Profiler redirect", compileRedirect2, game_data_type::CODE, game_data_type::STRING);
static auto _profilerCompileF = client::host::register_sqf_command("compileFinal", "Profiler redirect", compileRedirectFinal, compileFinal214 ? game_data_type::ANY : game_data_type::CODE, compileFinal214 ? game_data_type::ANY : game_data_type::STRING);
static auto _profilerCompileF = client::host::register_sqf_command("compileFinal", "Profiler redirect", compileRedirectFinal, game_data_type::CODE, game_data_type::CODE);


compileScriptFunc = (unary_function)host::functions.get_unary_function_typed("compilescript"sv, "ARRAY"sv);
Expand Down

0 comments on commit 561a490

Please sign in to comment.