diff options
| author | untodesu <kirill@untode.su> | 2025-12-26 14:50:33 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-12-26 14:50:33 +0500 |
| commit | 6c2abde5c99a236453b795abaa6d7d70105e31f7 (patch) | |
| tree | f085049b9615a7d03cca5de40adb6529d6c13e11 /src/game/server/world/unloader.cc | |
| parent | f40d09cb8f712e87691af4912f3630d92d692779 (diff) | |
| download | voxelius-6c2abde5c99a236453b795abaa6d7d70105e31f7.tar.bz2 voxelius-6c2abde5c99a236453b795abaa6d7d70105e31f7.zip | |
Just a big Ctrl+H refactoring
Diffstat (limited to 'src/game/server/world/unloader.cc')
| -rw-r--r-- | src/game/server/world/unloader.cc | 22 |
1 files changed, 11 insertions, 11 deletions
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<world::Inhabited>(event.chunk->get_entity()); + event.dimension->chunks.emplace_or_replace<Inhabited>(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<world::Inhabited>(event.chunk->get_entity()); + event.dimension->chunks.emplace_or_replace<Inhabited>(event.chunk->get_entity()); } -void world::unloader::init(void) +void unloader::init(void) { - globals::dispatcher.sink<world::ChunkUpdateEvent>().connect<&on_chunk_update>(); - globals::dispatcher.sink<world::VoxelSetEvent>().connect<&on_voxel_set>(); + globals::dispatcher.sink<ChunkUpdateEvent>().connect<&on_chunk_update>(); + globals::dispatcher.sink<VoxelSetEvent>().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<entity::Player, entity::Transform>); + auto group = dimension->entities.group(entt::get<Player, Transform>); auto boxes = std::vector<ChunkAABB>(); for(const auto [entity, transform] : group.each()) { @@ -70,7 +70,7 @@ void world::unloader::fixed_update_late(Dimension* dimension) if(dimension->chunks.any_of<Inhabited>(entity)) { // Only store inhabited chunks on disk - world::universe::save_chunk(dimension, chunk.cpos); + universe::save_chunk(dimension, chunk.cpos); } dimension->remove_chunk(entity); |
