add option custom user script, otclientrc.lua

This commit is contained in:
Eduardo Bart
2012-01-07 19:10:06 -02:00
parent 060d8740f5
commit ef0c625c41
11 changed files with 53 additions and 10 deletions

Binary file not shown.

View File

@@ -70,10 +70,18 @@ end
function resolvepath(filePath, depth)
depth = depth or 1
if filePath:sub(0, 1) ~= '/' then
return getfsrcpath(depth+1) .. '/' .. filePath
if filePath then
if filePath:sub(0, 1) ~= '/' then
local basepath = getfsrcpath(depth+1)
if basepath:sub(#basepath) ~= '/' then basepath = basepath .. '/' end
return basepath .. filePath
else
return filePath
end
else
return filePath
local basepath = getfsrcpath(depth+1)
if basepath:sub(#basepath) ~= '/' then basepath = basepath .. '/' end
return basepath
end
end
@@ -90,3 +98,7 @@ function tonumber(v)
if v == nil then return 0 end
return oldtonumber(v)
end
function runscript(file)
g_lua.runScript(resolvepath(file, 2))
end