mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
Merge branch 'dev' into pathfinding
This commit is contained in:
commit
67ef84d6b0
9 changed files with 97 additions and 5 deletions
|
|
@ -364,6 +364,19 @@ static int l_get_textures(lua::State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int l_model_name(lua::State* L) {
|
||||
if (auto def = require_block(L)) {
|
||||
// TODO: variant argument
|
||||
const auto& modelName = def->defaults.model.name;
|
||||
if (modelName.empty()) {
|
||||
return lua::pushlstring(L, def->name + ".model");
|
||||
}
|
||||
return lua::pushlstring(L, modelName);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_get_model(lua::State* L) {
|
||||
if (auto def = require_block(L)) {
|
||||
// TODO: variant argument
|
||||
|
|
@ -713,6 +726,7 @@ const luaL_Reg blocklib[] = {
|
|||
{"get_size", lua::wrap<l_get_size>},
|
||||
{"is_segment", lua::wrap<l_is_segment>},
|
||||
{"seek_origin", lua::wrap<l_seek_origin>},
|
||||
{"model_name", lua::wrap<l_model_name>},
|
||||
{"get_textures", lua::wrap<l_get_textures>},
|
||||
{"get_model", lua::wrap<l_get_model>},
|
||||
{"get_hitbox", lua::wrap<l_get_hitbox>},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue