Skip to content

Commit

Permalink
Next try
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed Apr 4, 2024
1 parent 2efceee commit c485837
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion _testing/gmod_testing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ local ret, err = pcall(function()

iFace = LuaThreaded.CreateInterface()
iFace:InitGmod()
iFace:RunFile("lua/includes/init.lua")
iFace:RunFile("includes/init.lua")
iFace:RunString(code)
iFace:RunHook("ExampleHook", "ExampleArg", 1234, Vector(1, 2, 3))
end)
Expand Down
12 changes: 1 addition & 11 deletions source/lua_ILuaInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,7 @@ void RunFile_Intern(ILuaThread* LUA, const char* file, FileHandle_t fh)

void RunFile(ILuaThread* LUA, const char* file)
{
std::string str_file = file;
if (str_file.substr(0, 4) == "lua/") {
str_file = str_file.substr(4);
}

char* maxpath = new char[511];
gpFileSystem->RelativePathToFullPath(file, "GAME", maxpath, sizeof(maxpath));

Msg("RunFile: %s %s\n", file, str_file.c_str());
LUA->IFace->FindAndRunScript(maxpath, true, true, "", true);
delete maxpath;
LUA->IFace->FindAndRunScript(file, true, true, "", true);

/*
std::string old_path = LUA->current_path;
Expand Down

0 comments on commit c485837

Please sign in to comment.