add entities.def_solid

This commit is contained in:
MihailRis 2026-07-21 22:49:10 +03:00
parent bed71ea607
commit 2d1e783a64

View file

@ -50,6 +50,13 @@ static int l_def_hitbox(lua::State* L) {
return 0;
}
static int l_def_solid(lua::State* L) {
if (auto def = require_entity_def(L)) {
return lua::pushboolean(L, def->solid);
}
return 0;
}
static int l_defs_count(lua::State* L) {
return lua::pushinteger(L, indices->entities.count());
}
@ -373,6 +380,7 @@ const luaL_Reg entitylib[] = {
{"def_index", lua::wrap<l_def_index>},
{"def_name", lua::wrap<l_def_name>},
{"def_hitbox", lua::wrap<l_def_hitbox>},
{"def_solid", lua::wrap<l_def_solid>},
{"get_def", lua::wrap<l_get_def>},
{"defs_count", lua::wrap<l_defs_count>},
{"spawn", lua::wrap<l_spawn>},