diff options
author | Vas Crabb <vas@vastheman.com> | 2020-11-28 16:27:19 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2020-11-28 16:27:19 +1100 |
commit | ee7ceb76b55bd9a062d2dbe69c0cdf24608811d9 (patch) | |
tree | 207e1e086febeb3e6429ec3c573ea4127c2b8378 | |
parent | 49e5d2f6c852865bc30a76d261928ddc382d9939 (diff) |
luaengine.cpp: Fix very dumb bug when retrieving self for containers.
-rw-r--r-- | src/frontend/mame/luaengine.ipp | 5 |
1 files 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<T *>(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<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()); - return **p; + else + return **p; } struct indexed_iterator |