From fcb214cc4cf141e25c1de10d78d18eb3db368c12 Mon Sep 17 00:00:00 2001 From: p2r3 Date: Wed, 27 Aug 2025 14:50:36 +0300 Subject: [PATCH] fix mob behavior on low tickrate --- src/procedures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/procedures.c b/src/procedures.c index 24e9827..7b3786f 100644 --- a/src/procedures.c +++ b/src/procedures.c @@ -1059,12 +1059,14 @@ void handleServerTick (int64_t time_since_last_tick) { uint32_t r = fast_rand(); + if ((unsigned int)TICKS_PER_SECOND >= 1) { if (passive) { // Update passive mobs once per 4 seconds on average if (r % (4 * (unsigned int)TICKS_PER_SECOND)) continue; } else { // Update hostile mobs once per second on average if (r % (unsigned int)TICKS_PER_SECOND) continue; + } } // Find the player closest to this mob @@ -1102,8 +1104,6 @@ void handleServerTick (int64_t time_since_last_tick) { if ((r >> 1) & 1) { new_z += 1; yaw = 0; } else { new_z -= 1; yaw = 128; } } - // Vary the yaw angle to look just a little less robotic - yaw += ((r >> 7) & 31) - 16; } else { // Hostile mob movement handling