We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When constructing an object, that (empty) object is pushed on the Lua stack before the constructor function is called.
template<class T> int LuaClass<T>::ConstructorProxy(lua_State* state) { LuaInstance& lua = *LuaInstance::GetInstance(state); std::shared_ptr<ClassInfo>& info = *static_cast<std::shared_ptr<ClassInfo>*>(lua.ToUserdata(lua.GetIndexOfUpValue(1))); const ConstructorFunc& constructor = info->constructor; lua.Remove(1); // On enlève l'argument "table" du stack T* instance = static_cast<T*>(lua.PushUserdata(sizeof(T))); //<<<<<< HERE if (!constructor(lua, instance))
which induce an extra parameter of type "userdata" on every constructor.
The text was updated successfully, but these errors were encountered:
578791c
Lua/LuaClass: Fix argument count via GetStackTop (Close #75)
bb12913
Former-commit-id: 3a0e60a6e7ec7c85ff5f179cc84a468d8c0682f4 [formerly f0712658e69c7ced1fa46f8878f96776d6b36567] [formerly 3035b072473d17863c3c0f6950451ccf582c107e [formerly 578791c]] Former-commit-id: df8812d712d28efc2bc83258df53dcb21bbb4b2d [formerly 6d2d8773c96d406690bd5cfc19cef7d1706ff6fc] Former-commit-id: 461fec0cc2dd99690a3de10436730514712beb73
SirLynix
No branches or pull requests
When constructing an object, that (empty) object is pushed on the Lua stack before the constructor function is called.
which induce an extra parameter of type "userdata" on every constructor.
The text was updated successfully, but these errors were encountered: