new player.* functions

This commit is contained in:
MihailRis
2024-05-24 01:38:39 +03:00
parent 0ad3dd7ab8
commit 1917cbba8b
16 changed files with 306 additions and 224 deletions
+4 -4
View File
@@ -40,14 +40,14 @@ static int l_hud_close_inventory(lua_State*) {
}
static int l_hud_open_block(lua_State* L) {
lua::luaint x = lua_tointeger(L, 1);
lua::luaint y = lua_tointeger(L, 2);
lua::luaint z = lua_tointeger(L, 3);
auto x = lua_tointeger(L, 1);
auto y = lua_tointeger(L, 2);
auto z = lua_tointeger(L, 3);
bool playerInventory = !lua_toboolean(L, 4);
voxel* vox = scripting::level->chunks->get(x, y, z);
if (vox == nullptr) {
throw std::runtime_error("block does not exists at "+
throw std::runtime_error("block does not exists at " +
std::to_string(x) + " " + std::to_string(y) + " " + std::to_string(z)
);
}