summaryrefslogtreecommitdiffstats
path: root/game/server/world/random_tick.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-12-11 15:14:26 +0500
committeruntodesu <kirill@untode.su>2025-12-11 15:14:26 +0500
commitf40d09cb8f712e87691af4912f3630d92d692779 (patch)
tree7ac3a4168ff722689372fd489c6f94d0a2546e8f /game/server/world/random_tick.cc
parent8bcbd2729388edc63c82d77d314b583af1447c49 (diff)
downloadvoxelius-f40d09cb8f712e87691af4912f3630d92d692779.tar.bz2
voxelius-f40d09cb8f712e87691af4912f3630d92d692779.zip
Shuffle stuff around
- Use the new and improved hierarchy I figured out when making Prospero chat - Re-add NSIS scripts, again from Prospero - Update most build and utility scripts with their most recent versions
Diffstat (limited to 'game/server/world/random_tick.cc')
-rw-r--r--game/server/world/random_tick.cc40
1 files changed, 0 insertions, 40 deletions
diff --git a/game/server/world/random_tick.cc b/game/server/world/random_tick.cc
deleted file mode 100644
index c5fa47c..0000000
--- a/game/server/world/random_tick.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "server/pch.hh"
-
-#include "server/world/random_tick.hh"
-
-#include "core/config/number.hh"
-
-#include "core/io/config_map.hh"
-
-#include "shared/world/chunk.hh"
-#include "shared/world/dimension.hh"
-#include "shared/world/voxel.hh"
-
-#include "shared/coord.hh"
-
-#include "server/globals.hh"
-
-static config::Int random_tick_speed(2, 1, 1000);
-static std::mt19937_64 random_source;
-
-void world::random_tick::init(void)
-{
- globals::server_config.add_value("world.random_tick_speed", random_tick_speed);
-
- random_source.seed(std::random_device {}());
-}
-
-void world::random_tick::tick(const chunk_pos& cpos, Chunk* chunk)
-{
- assert(chunk);
-
- for(int i = 0; i < random_tick_speed.get_value(); ++i) {
- auto voxel_index = random_source() % CHUNK_VOLUME;
- auto lpos = coord::to_local(voxel_index);
- auto vpos = coord::to_voxel(cpos, lpos);
-
- if(auto voxel = chunk->get_voxel(lpos)) {
- voxel->on_tick(chunk->get_dimension(), vpos);
- }
- }
-}