From 075ea9be5e9d9f4c43020a0cf8dcaae90813437f Mon Sep 17 00:00:00 2001 From: kosmik641 Date: Thu, 21 Nov 2024 20:21:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D1=80=D0=BE=D0=BA?= =?UTF-8?q?=D0=B8=20DLL=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B0=D1=80=D1=85=D0=B8=D1=82=D0=B5=D0=BA=D1=82=D1=83?= =?UTF-8?q?=D1=80=D1=8B,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=9E=D0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/sv_turbostroi_v2.lua | 44 +++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/lua/metrostroi/sv_turbostroi_v2.lua b/lua/metrostroi/sv_turbostroi_v2.lua index 567b2d5..7a5a176 100644 --- a/lua/metrostroi/sv_turbostroi_v2.lua +++ b/lua/metrostroi/sv_turbostroi_v2.lua @@ -202,15 +202,43 @@ end -------------------------------------------------------------------------------- -- NEW API local OSes = { - Windows = "win32", - Windows64 = "win64", - Linux = "linux", - Linux64 = "linux64", - BSD = "linux", - POSIX = "linux", - OSX = "osx", + Windows = { + x86 = "win32", + x64 = "win64" + }, + Linux = { + x86 = "linux", + x64 = "linux64" + }, + BSD = { + x86 = "linux", + x64 = "linux64" + }, + POSIX = { + x86 = "linux", + x64 = "linux64" + }, + OSX = { + x86 = "osx", + x64 = "osx" + }, + Other = { + x86 = "linux", + x64 = "linux64" + } } -local dllPath = "./garrysmod/lua/bin/gmsv_turbostroi_"..(OSes[jit.os] or "win32")..".dll" + +local postfix +if OSes[jit.os] then + postfix = OSes[jit.os][jit.arch] +end + +if postfix == nil then + print("Can't find gm_turbostroi DLL") + return +end + +local dllPath = "./garrysmod/lua/bin/gmsv_turbostroi_"..postfix..".dll" local ffi = require("ffi") ffi.cdef[[