luaengine.cpp: Fix very dumb bug when retrieving self for containers.

This commit is contained in:
Vas Crabb 2020-11-28 16:27:19 +11:00
parent 49e5d2f6c8
commit ee7ceb76b5

View File

@ -92,9 +92,10 @@ protected:
auto p(sol::stack::unqualified_check_get<T *>(L, 1)); auto p(sol::stack::unqualified_check_get<T *>(L, 1));
if (!p) if (!p)
luaL_error(L, "sol: 'self' is not of type '%s' (pass 'self' as first argument with ':' or call on proper type)", sol::detail::demangle<T>().c_str()); luaL_error(L, "sol: 'self' is not of type '%s' (pass 'self' as first argument with ':' or call on proper type)", sol::detail::demangle<T>().c_str());
if (*p) else if (!*p)
luaL_error(L, "sol: 'self' argument is nil (pass 'self' as first argument with ':' or call on a '%s' type", sol::detail::demangle<T>().c_str()); luaL_error(L, "sol: 'self' argument is nil (pass 'self' as first argument with ':' or call on a '%s' type", sol::detail::demangle<T>().c_str());
return **p; else
return **p;
} }
struct indexed_iterator struct indexed_iterator