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

Clamp the value between 0 and 1 to avoid tinygradient errors. #343

Conversation

mxrcode
Copy link
Contributor

@mxrcode mxrcode commented Jan 22, 2024

Previously, we could get a coefficient greater than 1, causing SquadJS to crash. One case is described here.
Now we clamp the ratio between 0 and 1, which prevents an error related to tinygradient

Copy link
Contributor

@fantinodavide fantinodavide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@werewolfboy13 werewolfboy13 linked an issue Jan 26, 2024 that may be closed by this pull request
Previously, we could get a coefficient greater than 1, causing SquadJS to crash. One case is described [here](Team-Silver-Sphere#342). 
Now we clamp the ratio between 0 and 1, which prevents an error related to tinygradient
@werewolfboy13 werewolfboy13 force-pushed the fixed-unclamped-ratio-for-tinygradient branch from cb74e94 to af6eab2 Compare February 5, 2024 02:22
@werewolfboy13 werewolfboy13 added core bug Bug related to the core SquadJS API patch Patch Change labels Feb 5, 2024
@werewolfboy13 werewolfboy13 merged commit 923c601 into Team-Silver-Sphere:master Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core bug Bug related to the core SquadJS API patch Patch Change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues updating discord server status
3 participants