cleanup World references

This commit is contained in:
MihailRis 2026-06-20 22:17:27 +03:00
parent ac00c561ee
commit c73b036099
18 changed files with 45 additions and 45 deletions

View file

@ -33,7 +33,7 @@ static Level& require_level() {
}
static WorldInfo& require_world_info() {
return require_level().getWorld()->getInfo();
return require_level().getWorld().getInfo();
}
static int l_is_open(lua::State* L) {
@ -136,7 +136,7 @@ static int l_get_chunk_data(lua::State* L) {
auto voxelData = std::make_unique<ubyte[]>(CHUNK_DATA_LEN);
std::vector<ubyte> chunkData;
if (chunk == nullptr) {
auto& regions = level->getWorld()->wfile->getRegions();
auto& regions = level->getWorld().wfile->getRegions();
if (!regions.getVoxels(x, z, voxelData.get())) {
return 0;
}
@ -215,7 +215,7 @@ static int l_save_chunk_data(lua::State* L) {
reinterpret_cast<const ubyte*>(buffer.data()),
reinterpret_cast<const ubyte*>(buffer.data()) + buffer.size()
),
level->getWorld()->wfile->getRegions()
level->getWorld().wfile->getRegions()
);
return 0;
}

View file

@ -310,7 +310,7 @@ void scripting::on_world_load(LevelController* controller) {
for (auto& pack : content_control->getAllContentPacks()) {
lua::emit_event(L, pack.id + ":.worldopen", [](auto L) {
return lua::pushboolean(
L, !scripting::level->getWorld()->getInfo().isLoaded
L, !scripting::level->getWorld().getInfo().isLoaded
);
});
}