Merge pull request #762 from MihailRis/fix-on_blocks_tick-interval

fix on_blocks_tick interval
This commit is contained in:
MihailRis 2025-12-29 21:15:45 +03:00 • committed by GitHub
commit 70f757757b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -24,7 +24,7 @@ BlocksController::BlocksController(const Level& level, Lighting* lighting)
chunks(*level.chunks),
lighting(lighting),
randTickClock(20, 3),
blocksTickClock(20, 1),
blocksTickClock(20, 3),
worldTickClock(20, 1) {
}
@ -124,7 +124,7 @@ void BlocksController::update(float delta, uint padding) {
randomTick(randTickClock.getPart(), randTickClock.getParts(), padding);
}
if (blocksTickClock.update(delta)) {
onBlocksTick(blocksTickClock.getPart(), blocksTickClock.getParts());
onBlocksTick(blocksTickClock.getTickId(), blocksTickClock.getParts());
}
if (worldTickClock.update(delta)) {
scripting::on_world_tick(worldTickClock.getTickRate());

View file

@ -18,6 +18,7 @@ bool Clock::update(float delta) {
tickTimer = std::fmod(tickTimer, delay);
tickPartsUndone = tickParts - 1;
}
++tickId;
return true;
}
return false;