Fix hunger and thirst status retrieval
Changed Framework.GetHunger and Framework.GetThirst to fetch the 'status' instead of 'hunger' or 'thirst' directly. This ensures the functions correctly iterate over the status table to find the relevant values.
This commit is contained in:
1 parent
aae3d540ff
commit
8bf02f6372
1 file changed
+2
-2
@@ -252,7 +252,7 @@ end
|
||||
--- @param src number
|
||||
--- @return number | nil
|
||||
Framework.GetHunger = function(src)
|
||||
local status = Framework.GetStatus(src, "hunger")
|
||||
local status = Framework.GetStatus(src, "status")
|
||||
if not status then return end
|
||||
if type(status) ~= "table" then return end
|
||||
for _, entry in ipairs(status) do
|
||||
@@ -266,7 +266,7 @@ end
|
||||
--- @param src any
|
||||
--- @return number | nil
|
||||
Framework.GetThirst = function(src)
|
||||
local status = Framework.GetStatus(src, "thirst")
|
||||
local status = Framework.GetStatus(src, "status")
|
||||
if not status then return nil end
|
||||
if type(status) ~= "table" then return end
|
||||
for _, entry in ipairs(status) do
|
||||
|
||||
Reference in new issue
Block a user