summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/luaengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/luaengine.cpp')
-rw-r--r--src/frontend/mame/luaengine.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index 2e93d725ed3..9dfc9aeee0b 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -1424,10 +1424,11 @@ void lua_engine::initialize()
[this] (device_t &dev)
{
sol::table st_table = sol().create_table();
- if(!dynamic_cast<device_state_interface *>(&dev))
+ const device_state_interface *state;
+ if(!dev.interface(state))
return st_table;
// XXX: refrain from exporting non-visible entries?
- for(auto &s : dev.state().state_entries())
+ for(auto &s : state->state_entries())
st_table[s->symbol()] = s.get();
return st_table;
});