From ee7ceb76b55bd9a062d2dbe69c0cdf24608811d9 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 28 Nov 2020 16:27:19 +1100 Subject: [PATCH] luaengine.cpp: Fix very dumb bug when retrieving self for containers. --- src/frontend/mame/luaengine.ipp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/mame/luaengine.ipp b/src/frontend/mame/luaengine.ipp index 8af5a937eb4..9d17bbba054 100644 --- a/src/frontend/mame/luaengine.ipp +++ b/src/frontend/mame/luaengine.ipp @@ -92,9 +92,10 @@ protected: auto p(sol::stack::unqualified_check_get(L, 1)); 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().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().c_str()); - return **p; + else + return **p; } struct indexed_iterator