-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hunger level increments only after first burger #470
Comments
After some time there is synchronization, but not immediately. |
So it works as expected, great. |
10 burgers without affecting hunger level is expected? |
Hunger level ~= metadata |
but are related --- sets player hunger level in statebag
--- @param source number
--- @param amount number
local function setHunger(source, amount)
amount = lib.math.clamp(amount, 0, 100)
Player(source).state.hunger = amount
--- hotfix
local player = exports.qbx_core:GetPlayer(source)
if not player then return end
player.Functions.SetMetaData('hunger', amount)
--- hotfix
end |
Think this can be closed now? |
Soon ™️ |
nvm, thought it wasn't a problem for a long time, forgot qbox still supported qb |
Summary
Metadata desynchronization problem still occurs, i think.
Enforcing sychronization helps.
Reproduction
Set hunger level to 10
Buy 2 burgers in a shop
Eat bought food
No hunger bar update after eating second burger
Set hunger level to 10
Spawn 3 twerks candies
/additem 1 twerks_candy 3
Eat food
Food level in admin menu does not update
Expected behavior
Update metadata on changes
Actual behavior
as in reproduction
Additional context
I made a hotfix in smallresources that partially fixes this, but the fix needs to be done qbx_core.
https://github.com/Qbox-project/qbx_smallresources/pull/99/files
Current Version
v1.12.0
Custom Resources
unreleased version of qbx_vehiclekeys
The text was updated successfully, but these errors were encountered: