diff --git a/src/scripting/lua_common.cpp b/src/scripting/lua_common.cpp index 26bc9352bc0bc..88da0273d3fdb 100644 --- a/src/scripting/lua_common.cpp +++ b/src/scripting/lua_common.cpp @@ -496,12 +496,12 @@ std::string register_vconfig_metatable(lua_State *L) } // end namespace lua_common -void* operator new(std::size_t sz, lua_State *L) +void* operator new(std::size_t sz, lua_State *L, int nuv) { - return lua_newuserdatauv(L, sz, 0); + return lua_newuserdatauv(L, sz, nuv); } -void operator delete(void*, lua_State *L) +void operator delete(void*, lua_State *L, int nuv) { // Not sure if this is needed since it's a no-op // It's only called if a constructor throws while using the above operator new diff --git a/src/scripting/lua_common.hpp b/src/scripting/lua_common.hpp index fda4ca22ab000..dbf2b59a5dd68 100644 --- a/src/scripting/lua_common.hpp +++ b/src/scripting/lua_common.hpp @@ -41,8 +41,8 @@ namespace lua_common { } -void* operator new(std::size_t sz, lua_State *L); -void operator delete(void* p, lua_State *L); +void* operator new(std::size_t sz, lua_State *L, int nuv = 0); +void operator delete(void* p, lua_State *L, int nuv); /** * Like luaL_getmetafield, but returns false if key is an empty string