1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-01 23:25:09 +02:00

add option to tie movement updates to tickrate

This commit is contained in:
p2r3
2025-09-11 22:00:32 +03:00
parent e4c0c6b6e9
commit a83acbda67
3 changed files with 35 additions and 6 deletions

View File

@@ -1424,6 +1424,11 @@ void handleServerTick (int64_t time_since_last_tick) {
player->flagval_16 = 0;
} else player->flagval_16 ++;
}
// Reset movement update cooldown if not broadcasting every update
// Effectively ties player movement updates to the tickrate
#ifndef BROADCAST_ALL_MOVEMENT
player->flags &= ~0x40;
#endif
// Below this, process events that happen once per second
if (server_ticks % (uint32_t)TICKS_PER_SECOND != 0) continue;
// Send Keep Alive and Update Time packets