From 0a69ab7d185130e69c664a367ac8188219e31e9d Mon Sep 17 00:00:00 2001 From: IntegratedQuantum Date: Wed, 1 Jan 2025 21:40:33 +0100 Subject: [PATCH] Fix integer overflow when setting the gameTime to a high value. fixes #860 --- src/server/world.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/world.zig b/src/server/world.zig index 132e91ba..62ecbd63 100644 --- a/src/server/world.zig +++ b/src/server/world.zig @@ -811,7 +811,7 @@ pub const ServerWorld = struct { // MARK: ServerWorld while(self.milliTime + 100 < newTime) { self.milliTime += 100; - if(self.doGameTimeCycle) self.gameTime += 1; // gameTime is measured in 100ms. + if(self.doGameTimeCycle) self.gameTime +%= 1; // gameTime is measured in 100ms. } if(self.lastUnimportantDataSent + 2000 < newTime) {// Send unimportant data every ~2s. self.lastUnimportantDataSent = newTime;