Fix binary loading

This commit is contained in:
Vauff 2023-10-03 16:45:32 -04:00
parent 1736025b12
commit ef9f935dcb

View file

@ -57,11 +57,12 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl
PLUGIN_SAVEVARS(); PLUGIN_SAVEVARS();
int PatchLen = strlen(pPatchPattern); int PatchLen = strlen(pPatchPattern);
char pBinPath[MAX_PATH];
#ifdef _WIN32 #ifdef _WIN32
char const *pBinPath = "csgo/bin/win64/server.dll"; V_snprintf(pBinPath, MAX_PATH, "%s%s", Plat_GetGameDirectory(), "/csgo/bin/win64/server.dll");
auto *pBin = LoadLibrary(pBinPath); auto *pBin = LoadLibrary(pBinPath);
#elif __linux__ #elif __linux__
char const *pBinPath = "csgo/bin/linuxsteamrt64/libserver.so"; V_snprintf(pBinPath, MAX_PATH, "%s%s", Plat_GetGameDirectory(), "/csgo/bin/linuxsteamrt64/libserver.so");
auto *pBin = dlopen(pBinPath, RTLD_NOW); auto *pBin = dlopen(pBinPath, RTLD_NOW);
#endif #endif