virtual inventory fix

This commit is contained in:
MihailRis 2024-02-20 18:39:36 +03:00
parent 539a79c22c
commit 052ad45a6f
2 changed files with 0 additions and 9 deletions

View File

@ -447,8 +447,6 @@ void Hud::openInventory(glm::ivec3 block, UiDocument* doc, std::shared_ptr<Inven
}
openInventory();
if (blockinv == nullptr) {
Events::toggleCursor();
abort();
blockinv = level->inventories->createVirtual(blockUI->getSlotsCount());
}
level->chunks->getChunkByVoxel(block.x, block.y, block.z)->setUnsaved(true);

View File

@ -53,13 +53,6 @@ int l_hud_open_block(lua_State* L) {
}
auto id = scripting::blocks->createBlockInventory(x, y, z);
if (id == 0) {
luaL_error(L,
"block '%s' at %d %d %d has no inventory",
def->name.c_str(),
x, y, z
);
}
scripting::hud->openInventory(
glm::ivec3(x, y, z), layout, scripting::level->inventories->get(id)