update libitem.cpp

This commit is contained in:
MihailRis 2026-03-09 16:46:12 +03:00
parent 5304223e95
commit b49e2106b3

View file

@ -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);