From a7a51a82489a53fe3bb4642688120e2c882b590f Mon Sep 17 00:00:00 2001 From: Pawmi <228jopen228@gmail.com> Date: Sun, 12 Oct 2025 02:54:40 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20TPS=20calculation=20ignoring=20server?= =?UTF-8?q?=E2=80=99s=20max=20tickrate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EXILED/Exiled.API/Features/Server.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/EXILED/Exiled.API/Features/Server.cs b/EXILED/Exiled.API/Features/Server.cs index e07764d9e9..fd4e509904 100644 --- a/EXILED/Exiled.API/Features/Server.cs +++ b/EXILED/Exiled.API/Features/Server.cs @@ -111,7 +111,22 @@ public static string Name /// /// Gets the actual ticks per second of the server. /// - public static double Tps => Math.Round(1f / Time.smoothDeltaTime); + public static double Tps + { + get + { + double delta = Time.deltaTime; + + if (delta <= 0) + return MaxTps; + + double tps = 1d / delta; + + tps = Math.Min(tps, MaxTps); + + return tps; + } + } /// /// Gets or sets the max ticks per second of the server.