fix player ticks

This commit is contained in:
MihailRis 2026-05-03 17:51:52 +03:00
parent 957ef0aed3
commit 47f2bf75d7
3 changed files with 7 additions and 9 deletions

View file

@ -104,10 +104,12 @@ void LevelController::update(float delta, bool pause) {
if (player->isSuspended()) { if (player->isSuspended()) {
continue; continue;
} }
if (playerTickClock.update(delta)) { if (int parts = playerTickClock.update(delta)) {
if (player->getId() % playerTickClock.getParts() == for (int i = 0; i < parts; i++) {
playerTickClock.getPart()) { if (player->getId() % playerTickClock.getParts() !=
playerTickClock.convertPart(i)) {
continue;
}
const auto& position = player->getPosition(); const auto& position = player->getPosition();
if (player->chunks->get( if (player->chunks->get(
std::floor(position.x), std::floor(position.x),
@ -119,6 +121,7 @@ void LevelController::update(float delta, bool pause) {
); );
} }
} }
} }
} }
} }

View file

@ -27,10 +27,6 @@ int Clock::update(float delta) {
return parts; return parts;
} }
int Clock::getPart() const {
return currentTickPart;
}
int Clock::getParts() const { int Clock::getParts() const {
return tickParts; return tickParts;
} }

View file

@ -13,7 +13,6 @@ namespace util {
int update(float delta); int update(float delta);
int getPart() const;
int getParts() const; int getParts() const;
int getTickRate() const; int getTickRate() const;
int getTickId() const; int getTickId() const;