Skip to content
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

Statuses not Updating Correctly #589

Open
Redacted42 opened this issue Sep 30, 2024 · 1 comment
Open

Statuses not Updating Correctly #589

Redacted42 opened this issue Sep 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Redacted42
Copy link

Summary

the self.Functions.SetMetaData function runs too quick. when a value is above the max, it just sets the value back to the value (above the max).

Reproduction

  1. Adding a Statebag Getter for Food and Printing It
  2. Eating Food from ox_inventory when having 100 Hunger

Expected behavior

Getting 2 Statebag Changes. The Initial Value from ox_inventory and then the Value being set by self.Functions.SetMetaData

Actual behavior

Getting 3 Statebag Changes. the First Being the Initial Value Set by Ox_Inv (The Value thats too High), the Second Value being 100 (The Value Set by the self.Functions.SetMetaData function). and Third, the Initial Value from Ox_Inv (Again).

this Results in the Hunger Value Staying at the High Value.

Additional context

No response

Current Version

v1.20.1

Custom Resources

none affecting status / hunger.

@Redacted42 Redacted42 added bug Something isn't working need repro This bug report needs confirmation labels Sep 30, 2024
@qbox-duck qbox-duck bot added this to Issues Sep 30, 2024
@github-project-automation github-project-automation bot moved this to Todo in Issues Sep 30, 2024
@solareon solareon removed the need repro This bug report needs confirmation label Sep 30, 2024
@solareon
Copy link
Contributor

solareon commented Sep 30, 2024

This is due to setting the value prior to clamping the value then setting it to the statebag. The value needs to be clamped before being set to the statebag. Good catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants