Skip to content

Commit

Permalink
Now were going to try to fix RunHook
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed Apr 3, 2024
1 parent 28099ac commit 893ca1a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _testing/gmod_testing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ local ret, err = pcall(function()
iFace:InitGmod()
iFace:RunFile("lua/includes/init.lua")
iFace:RunString(code)
--iFace:RunHook("ExampleHook", "ExampleArg", 1234, Vector(1, 2, 3))
iFace:RunHook("ExampleHook", "ExampleArg", 1234, Vector(1, 2, 3))
end)

if err then
Expand Down
1 change: 1 addition & 0 deletions source/library_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ void AsyncCallback(const FileAsyncRequest_t &request, int nBytesRead, FSAsyncSta
{
async->finished = true;
async->nBytesRead = nBytesRead;
Msg("Read %i\n", nBytesRead);
} else {
Msg("[Luathreaded] file.AsyncRead Invalid request?\n");
}
Expand Down
6 changes: 3 additions & 3 deletions source/lua_ILuaInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ LUA_FUNCTION(ILuaInterface_RunHook)
const char* name = LUA->CheckString(2);

ILuaValue* hook_tbl = new ILuaValue;
hook_tbl->type = Type::Table;
/*hook_tbl->type = Type::Table;
hook_tbl->number = LUA->Top() - 2;
if (hook_tbl->number > 0)
Expand All @@ -550,7 +550,7 @@ LUA_FUNCTION(ILuaInterface_RunHook)
hook_tbl->tbl[CreateValue(std::to_string(pos - 2).c_str())] = val;
}
}
}*/

if (thread->threaded)
{
Expand Down Expand Up @@ -673,7 +673,7 @@ unsigned LuaThread(void* data)
RunGameevent(IFace, action->data, action->val);
} else if (action->type == LuaAction::ACT_RunHook)
{
RunHook(IFace, action->data, action->val);
//RunHook(IFace, action->data, action->val);
}

delete action;
Expand Down
2 changes: 1 addition & 1 deletion source/lua_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ struct ILuaValue

double number = -1;
const char* string = "";
std::unordered_map<ILuaValue*, ILuaValue*> tbl;
Vector vec;
QAngle ang;
std::unordered_map<ILuaValue*, ILuaValue*> tbl;
};

struct ILuaAction
Expand Down

0 comments on commit 893ca1a

Please sign in to comment.