move Chunks from Level to Player
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "voxels/Block.hpp"
|
||||
#include "voxels/Chunks.hpp"
|
||||
#include "voxels/voxel.hpp"
|
||||
#include "voxels/blocks_agent.hpp"
|
||||
#include "world/Level.hpp"
|
||||
#include "api_lua.hpp"
|
||||
|
||||
@@ -59,7 +60,7 @@ static int l_open_block(lua::State* L) {
|
||||
auto z = lua::tointeger(L, 3);
|
||||
bool playerInventory = !lua::toboolean(L, 4);
|
||||
|
||||
auto vox = level->chunks->get(x, y, z);
|
||||
auto vox = blocks_agent::get(*level->chunksStorage, x, y, z);
|
||||
if (vox == nullptr) {
|
||||
throw std::runtime_error(
|
||||
"block does not exists at " + std::to_string(x) + " " +
|
||||
|
||||
Reference in New Issue
Block a user