mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
fixes for ARM
This commit is contained in:
@@ -32,10 +32,25 @@ function createEnvironment()
|
||||
return env
|
||||
end
|
||||
|
||||
function getCallingScriptSourcePath(depth)
|
||||
depth = depth or 2
|
||||
local info = debug.getinfo(1+depth, "Sn")
|
||||
local path
|
||||
if info.short_src then
|
||||
path = info.short_src:match("(.*)/.*")
|
||||
end
|
||||
if not path then
|
||||
path = '/'
|
||||
elseif path:sub(0, 1) ~= '/' then
|
||||
path = '/' .. path
|
||||
end
|
||||
return path
|
||||
end
|
||||
|
||||
function resolveFileFullPath(filePath, depth)
|
||||
depth = depth or 1
|
||||
if filePath:sub(0, 1) ~= '/' then
|
||||
return getCurrentSourcePath(depth+1) .. '/' .. filePath
|
||||
return getCallingScriptSourcePath(depth+1) .. '/' .. filePath
|
||||
else
|
||||
return filePath
|
||||
end
|
||||
|
Reference in New Issue
Block a user