mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
luaengine: avoid null keys (nw)
This commit is contained in:
parent
dfa1577df0
commit
0a23279f0b
@ -664,7 +664,8 @@ luabridge::LuaRef lua_engine::l_ioports_port_get_fields(const ioport_port *i)
|
||||
luabridge::LuaRef f_table = luabridge::LuaRef::newTable(L);
|
||||
|
||||
for (ioport_field &field : p->fields()) {
|
||||
f_table[field.name()] = &field;
|
||||
if(field.name())
|
||||
f_table[field.name()] = &field;
|
||||
}
|
||||
|
||||
return f_table;
|
||||
@ -2224,6 +2225,7 @@ void lua_engine::initialize()
|
||||
.addProperty ("analog_wraps", &ioport_field::analog_wraps)
|
||||
.addProperty ("analog_invert", &ioport_field::analog_invert)
|
||||
.addProperty ("impulse", &ioport_field::impulse)
|
||||
.addProperty ("type", &ioport_field::type)
|
||||
.addProperty <double, double> ("crosshair_scale", &ioport_field::crosshair_scale, &ioport_field::set_crosshair_scale)
|
||||
.addProperty <double, double> ("crosshair_offset", &ioport_field::crosshair_offset, &ioport_field::set_crosshair_offset)
|
||||
.endClass()
|
||||
|
Loading…
Reference in New Issue
Block a user