Skip to content

Commit

Permalink
fixed server loop tps
Browse files Browse the repository at this point in the history
was integer division which meant that the sleep time wasn't correct, now
using standard division which results in proper tps regulation
  • Loading branch information
moltenwolfcub committed Dec 24, 2024
1 parent da7a06b commit 2c57dc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def main_loop(self) -> None:
time_remaining_ns = self.game.settings.tick_time_ns - (tick_stop-tick_start)

if time_remaining_ns > 0:
time.sleep(time_remaining_ns//1_000_000_000)
time.sleep(time_remaining_ns/1_000_000_000)

def console_loop(self) -> None:
'''Handles server console commands'''
Expand Down

0 comments on commit 2c57dc9

Please sign in to comment.