Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix clock spinning violently from undefined behavior with bad casting #849

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Nov 13, 2024

This fixes the clock rings and face from spinning rapidly on some platforms (Mac and Android). The issue is caused by undefined behavior from casting a float value that is larger than short_max into a s16. Simply adding casting to a s32 first deals with the large value correctly, then that can be cast to s16 without undefined behavior.

Fixes #437

Build Artifacts

@Archez Archez linked an issue Nov 13, 2024 that may be closed by this pull request
@Archez Archez merged commit 1afe496 into HarbourMasters:develop-satoko Nov 13, 2024
5 checks passed
@Archez Archez deleted the fix-clock-spinning branch November 13, 2024 19:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clocktower gears move erratically [Mac - Release mode]
2 participants