From 6317dee667399e1c6e45174e6483d4c9e3dc2750 Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Wed, 1 Oct 2025 21:43:14 +0100 Subject: [PATCH] Stop double calculation of hunger and thirst Missed this, it's doing the player stats + new stats and then in jim_bridge doing this again and doubling it all up --- client/client.lua | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/client/client.lua b/client/client.lua index 229f071..3f040a3 100644 --- a/client/client.lua +++ b/client/client.lua @@ -294,31 +294,17 @@ RegisterNetEvent(getScript()..':Consume', function(itemName) if not cancelled then hideText() - local needTypes = { } + local needTypes = { } if needStats then --jsonPrint(needStats) if needStats.hunger > 0 then - if Core and Core.Functions then - needTypes.hunger = (Core.Functions.GetPlayerData().metadata["hunger"] or 0) + needStats.hunger - needTypes.hunger = needTypes.hunger > 100 and 100 or needTypes.hunger - - elseif ESX and ESX.GetPlayerData then - needTypes.hunger = (needStats.hunger / 100) * 1000000 - needTypes.hunger = needTypes.hunger > 1000000 and 1000000 or needTypes.hunger - end + needTypes.hunger = needTypes.hunger > 100 and 100 or needTypes.hunger end if needStats.thirst > 0 then - if Core and Core.Functions then - needTypes.thirst = (Core.Functions.GetPlayerData().metadata["thirst"] or 0) + needStats.thirst - needTypes.thirst = needTypes.thirst > 100 and 100 or needTypes.thirst - - elseif ESX and ESX.GetPlayerData then - needTypes.thirst = (needStats.thirst / 100) * 1000000 - needTypes.thirst = needTypes.thirst > 1000000 and 1000000 or needTypes.thirst - end + needTypes.thirst = needTypes.thirst > 100 and 100 or needTypes.thirst end end TriggerServerEvent(getScript()..":server:finishConsume", needTypes)