Skip to content

Commit

Permalink
Set accidentally-forgotten indices on query args
Browse files Browse the repository at this point in the history
  • Loading branch information
piepie62 committed May 31, 2024
1 parent 09aa1c9 commit 3d29ba8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions BG3Extender/Lua/LuaOsiBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1533,22 +1533,32 @@ namespace bg3se::ecl::lua
case LUA_TLIGHTUSERDATA:
{
auto handle = get<EntityHandle>(L, idx);
query->add_args()->set_intv((int64_t)handle.Handle);
auto arg = query->add_args();
arg->set_index(i);
arg->set_intv((int64_t)handle.Handle);
break;
}
case LUA_TNUMBER:
{
auto arg = query->add_args();
arg->set_index(i);
if (lua_isinteger(L, idx))
{
query->add_args()->set_intv(lua_tointeger(L, idx));
arg->set_intv(lua_tointeger(L, idx));
}
else
{
query->add_args()->set_numv((float)lua_tonumber(L, idx));
arg->set_numv((float)lua_tonumber(L, idx));
}
break;
}
case LUA_TSTRING:
query->add_args()->set_strv(lua_tostring(L, idx));
{
auto arg = query->add_args();
arg->set_index(i);
arg->set_strv(lua_tostring(L, idx));
break;
}
}
}

Expand Down

0 comments on commit 3d29ba8

Please sign in to comment.