From 6c2abde5c99a236453b795abaa6d7d70105e31f7 Mon Sep 17 00:00:00 2001 From: untodesu Date: Fri, 26 Dec 2025 14:50:33 +0500 Subject: Just a big Ctrl+H refactoring --- src/game/server/world/unloader.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/game/server/world/unloader.cc') diff --git a/src/game/server/world/unloader.cc b/src/game/server/world/unloader.cc index 4a3f4e1..5842b14 100644 --- a/src/game/server/world/unloader.cc +++ b/src/game/server/world/unloader.cc @@ -17,29 +17,29 @@ #include "server/game.hh" #include "server/globals.hh" -static void on_chunk_update(const world::ChunkUpdateEvent& event) +static void on_chunk_update(const ChunkUpdateEvent& event) { - event.dimension->chunks.emplace_or_replace(event.chunk->get_entity()); + event.dimension->chunks.emplace_or_replace(event.chunk->get_entity()); } -static void on_voxel_set(const world::VoxelSetEvent& event) +static void on_voxel_set(const VoxelSetEvent& event) { - event.dimension->chunks.emplace_or_replace(event.chunk->get_entity()); + event.dimension->chunks.emplace_or_replace(event.chunk->get_entity()); } -void world::unloader::init(void) +void unloader::init(void) { - globals::dispatcher.sink().connect<&on_chunk_update>(); - globals::dispatcher.sink().connect<&on_voxel_set>(); + globals::dispatcher.sink().connect<&on_chunk_update>(); + globals::dispatcher.sink().connect<&on_voxel_set>(); } -void world::unloader::init_late(void) +void unloader::init_late(void) { } -void world::unloader::fixed_update_late(Dimension* dimension) +void unloader::fixed_update_late(Dimension* dimension) { - auto group = dimension->entities.group(entt::get); + auto group = dimension->entities.group(entt::get); auto boxes = std::vector(); for(const auto [entity, transform] : group.each()) { @@ -70,7 +70,7 @@ void world::unloader::fixed_update_late(Dimension* dimension) if(dimension->chunks.any_of(entity)) { // Only store inhabited chunks on disk - world::universe::save_chunk(dimension, chunk.cpos); + universe::save_chunk(dimension, chunk.cpos); } dimension->remove_chunk(entity); -- cgit