diff --git a/lua/starfall/libs_sh/builtins.lua b/lua/starfall/libs_sh/builtins.lua index 3b60ac906..f60c01585 100644 --- a/lua/starfall/libs_sh/builtins.lua +++ b/lua/starfall/libs_sh/builtins.lua @@ -777,8 +777,9 @@ function builtins_library.requiredir(path, loadpriority) if loadpriority~=nil then checkluatype(loadpriority, TYPE_TABLE) end path = SF.ChoosePath(path, string.GetPathFromFilename(SF.GetExecutingPath() or ""), function(testpath) + testpath = testpath .. "/" for file in pairs(instance.scripts) do - if testpath == string.sub(string.GetPathFromFilename(file), 1, -2) then + if testpath == string.GetPathFromFilename(file) then return true end end @@ -830,8 +831,9 @@ function builtins_library.dodir(path, loadpriority) if loadpriority ~= nil then checkluatype(loadpriority, TYPE_TABLE) end path = SF.ChoosePath(path, string.GetPathFromFilename(SF.GetExecutingPath() or ""), function(testpath) + testpath = testpath .. "/" for file in pairs(instance.scripts) do - if testpath == string.sub(string.GetPathFromFilename(file), 1, -2) then + if testpath == string.GetPathFromFilename(file) then return true end end