Lua/LuaState: Fix std::vector query for good

This commit is contained in:
Lynix 2018-06-24 21:49:51 +02:00
parent 456a9258da
commit bf37688b11
1 changed files with 3 additions and 3 deletions

View File

@ -172,11 +172,11 @@ namespace Nz
Nz::CallOnExit popStack { [&instance]() { instance.Pop(); } };
instance.PushInteger(pos++);
if (instance.GetTable(index) == Nz::LuaType_Nil)
int tableIndex = (index < 0) ? index - 1 : index;
if (instance.GetTable(tableIndex) == Nz::LuaType_Nil)
break;
T arg {};
T arg;
if (LuaImplQueryArg(instance, -1, &arg, TypeTag<T>()) != 1)
{
instance.Error("Type needs more than one place to be initialized");