mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
update libitem.cpp
This commit is contained in:
parent
5304223e95
commit
b49e2106b3
1 changed files with 3 additions and 0 deletions
|
|
@ -8,6 +8,9 @@
|
|||
using namespace scripting;
|
||||
|
||||
static const ItemDef* get_item_def(lua::State* L, int idx) {
|
||||
if (content == nullptr) {
|
||||
throw std::runtime_error("content is not initialized");
|
||||
}
|
||||
auto indices = content->getIndices();
|
||||
auto id = lua::tointeger(L, idx);
|
||||
return indices->items.get(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue