luadebug tmtrainer + spaces -> tabs
This commit is contained in:
1 parent
3484e9105b
commit
82de50749f
1 file changed
+13
-12
@@ -94,20 +94,21 @@ local nullVector = Vector(0,0)
|
|||||||
local modfolder ='external item descriptions_836319872' --release mod folder name
|
local modfolder ='external item descriptions_836319872' --release mod folder name
|
||||||
|
|
||||||
local function GetCurrentModPath()
|
local function GetCurrentModPath()
|
||||||
if debug then
|
if debug then
|
||||||
return string.sub(debug.getinfo(GetCurrentModPath).source,2) .. "/../"
|
if REPENTANCE then require("eid_tmtrainer") end
|
||||||
end
|
return string.sub(debug.getinfo(GetCurrentModPath).source,2) .. "/../"
|
||||||
--use some very hacky trickery to get the path to this mod
|
end
|
||||||
local _, err = pcall(require, "")
|
--use some very hacky trickery to get the path to this mod
|
||||||
local _, basePathStart = string.find(err, "no file '", 1)
|
local _, err = pcall(require, "")
|
||||||
local _, modPathStart = string.find(err, "no file '", basePathStart)
|
local _, basePathStart = string.find(err, "no file '", 1)
|
||||||
local modPathEnd, _ = string.find(err, ".lua'", modPathStart)
|
local _, modPathStart = string.find(err, "no file '", basePathStart)
|
||||||
local modPath = string.sub(err, modPathStart+1, modPathEnd-1)
|
local modPathEnd, _ = string.find(err, ".lua'", modPathStart)
|
||||||
modPath = string.gsub(modPath, "\\", "/")
|
local modPath = string.sub(err, modPathStart+1, modPathEnd-1)
|
||||||
|
modPath = string.gsub(modPath, "\\", "/")
|
||||||
modPath = string.gsub(modPath, "//", "/")
|
modPath = string.gsub(modPath, "//", "/")
|
||||||
modPath = string.gsub(modPath, ":/", ":\\")
|
modPath = string.gsub(modPath, ":/", ":\\")
|
||||||
|
|
||||||
return modPath
|
return modPath
|
||||||
end
|
end
|
||||||
EID.modPath = GetCurrentModPath()
|
EID.modPath = GetCurrentModPath()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user