mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-11-21 15:18:33 +00:00
Make GenerateRandomValues() return 0
Its possible if no health, thirst or stress was set, it may sent back an empty table, which would then break the finish consume function in the server
This commit is contained in:
1 parent
38d0b04e71
commit
d7a8a20491
1 file changed
+5
-3
+5
-3
@@ -15,6 +15,7 @@ function GenerateRandomValues(data)
|
||||
transData[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
if transData.hunger > 0 then
|
||||
transData.hunger = transData.hunger > 100 and 100 or transData.hunger
|
||||
end
|
||||
@@ -26,12 +27,13 @@ function GenerateRandomValues(data)
|
||||
if transData.stress > 0 then
|
||||
transData.stress = transData.stress > 100 and 100 or transData.stress
|
||||
end
|
||||
|
||||
return transData["time"],
|
||||
transData["heal"],
|
||||
transData["armor"],
|
||||
{
|
||||
hunger = transData["hunger"],
|
||||
thirst = transData["thirst"],
|
||||
stress = transData["stress"]
|
||||
hunger = transData["hunger"] or 0,
|
||||
thirst = transData["thirst"] or 0,
|
||||
stress = transData["stress"] or 0
|
||||
}
|
||||
end
|
||||
Reference in new issue
Block a user