Skip to content

Commit

Permalink
Next test
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed Apr 5, 2024
1 parent e22b9b1 commit 592ed49
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions source/lua_ILuaInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,24 +551,23 @@ void RunHook(GarrysMod::Lua::ILuaInterface* LUA, const char* name, ILuaValue* ar
{
LUA->Pop(1);

/*
LUA->PushString(name);
int pushed = 1;
if (args->type != GarrysMod::Lua::Type::Table)
{
for(auto&[key, val] : args->tbl)
{
++pushed;
PushValue(LUA, val);
//++pushed;
//PushValue(LUA, val);
}
} else {
++pushed;
PushValue(LUA, args);
//++pushed;
//PushValue(LUA, args);
}

LUA->CallFunctionProtected(pushed, 0, true);

if (args->type != GarrysMod::Lua::Type::Table && pushed != args->number) // We use pushed as a safeguard if something somehow breaks stuff.
/*if (args->type != GarrysMod::Lua::Type::Table && pushed != args->number) // We use pushed as a safeguard if something somehow breaks stuff.
{
std::string err_msg = "hook.Run had an Internal error. Report this please";
err_msg = err_msg + "(" + name + ")";
Expand Down

0 comments on commit 592ed49

Please sign in to comment.