From 08c3d937d61fa4ed4702d433b95312109fdbb679 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Wed, 10 Sep 2025 11:19:55 -0400 Subject: [PATCH] Round hunger and thirst values to nearest integer Updated GetHunger and GetThirst functions to return rounded integer values using math.floor(value + 0.5) for consistency and to avoid floating point results. --- modules/framework/qbx_core/server.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/framework/qbx_core/server.lua b/modules/framework/qbx_core/server.lua index de994dd..e20c2c5 100644 --- a/modules/framework/qbx_core/server.lua +++ b/modules/framework/qbx_core/server.lua @@ -234,7 +234,7 @@ Framework.GetHunger = function(src) if not player then return end local playerData = player.PlayerData local newHunger = (playerData.metadata.hunger or 0) - return newHunger + return math.floor((newHunger) + 0.5) or 0 end ---This will return a boolean if the player is dead or in last stand. @@ -265,7 +265,7 @@ Framework.GetThirst = function(src) if not player then return end local playerData = player.PlayerData local newThirst = (playerData.metadata.thirst or 0) - return newThirst + return math.floor((newThirst) + 0.5) or 0 end ---Returns the phone number of the player.