Hopefully fixed the whole plugin mess I started

This commit is contained in:
WerWolv
2021-01-12 23:28:41 +01:00
parent 8ae15abb85
commit dc85616549
27 changed files with 137 additions and 173 deletions

View File

@@ -179,10 +179,10 @@ namespace hex {
}
bool LoaderScript::processFile(std::string_view scriptPath) {
Py_SetProgramName(Py_DecodeLocale((*SharedData::get().mainArgv)[0], nullptr));
Py_SetProgramName(Py_DecodeLocale((SharedData::mainArgv)[0], nullptr));
if (std::filesystem::exists(std::filesystem::path((*SharedData::get().mainArgv)[0]).parent_path().string() + "/lib/python" PYTHON_VERSION_MAJOR_MINOR))
Py_SetPythonHome(Py_DecodeLocale(std::filesystem::path((*SharedData::get().mainArgv)[0]).parent_path().string().c_str(), nullptr));
if (std::filesystem::exists(std::filesystem::path((SharedData::mainArgv)[0]).parent_path().string() + "/lib/python" PYTHON_VERSION_MAJOR_MINOR))
Py_SetPythonHome(Py_DecodeLocale(std::filesystem::path((SharedData::mainArgv)[0]).parent_path().string().c_str(), nullptr));
PyImport_AppendInittab("_imhex", []() -> PyObject* {