virtual inventory fix
This commit is contained in:
parent
539a79c22c
commit
052ad45a6f
@ -447,8 +447,6 @@ void Hud::openInventory(glm::ivec3 block, UiDocument* doc, std::shared_ptr<Inven
|
|||||||
}
|
}
|
||||||
openInventory();
|
openInventory();
|
||||||
if (blockinv == nullptr) {
|
if (blockinv == nullptr) {
|
||||||
Events::toggleCursor();
|
|
||||||
abort();
|
|
||||||
blockinv = level->inventories->createVirtual(blockUI->getSlotsCount());
|
blockinv = level->inventories->createVirtual(blockUI->getSlotsCount());
|
||||||
}
|
}
|
||||||
level->chunks->getChunkByVoxel(block.x, block.y, block.z)->setUnsaved(true);
|
level->chunks->getChunkByVoxel(block.x, block.y, block.z)->setUnsaved(true);
|
||||||
|
|||||||
@ -53,13 +53,6 @@ int l_hud_open_block(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto id = scripting::blocks->createBlockInventory(x, y, z);
|
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(
|
scripting::hud->openInventory(
|
||||||
glm::ivec3(x, y, z), layout, scripting::level->inventories->get(id)
|
glm::ivec3(x, y, z), layout, scripting::level->inventories->get(id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user