mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add entities.def_hitbox function
This commit is contained in:
parent
e37e45d9d5
commit
effdac2d4d
4 changed files with 18 additions and 2 deletions
|
|
@ -34,6 +34,14 @@ static int l_def_name(lua::State* L) {
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_def_hitbox(lua::State* L) {
|
||||
if (auto def = require_entity_def(L)) {
|
||||
return lua::pushvec(L, def->hitbox);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_defs_count(lua::State* L) {
|
||||
return lua::pushinteger(L, indices->entities.count());
|
||||
}
|
||||
|
|
@ -202,6 +210,7 @@ const luaL_Reg entitylib[] = {
|
|||
{"exists", lua::wrap<l_exists>},
|
||||
{"def_index", lua::wrap<l_def_index>},
|
||||
{"def_name", lua::wrap<l_def_name>},
|
||||
{"def_hitbox", lua::wrap<l_def_hitbox>},
|
||||
{"get_def", lua::wrap<l_get_def>},
|
||||
{"defs_count", lua::wrap<l_defs_count>},
|
||||
{"spawn", lua::wrap<l_spawn>},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue