ASYLUM: Fix crash for game menu#6385
Merged
antoniou79 merged 2 commits intoscummvm:masterfrom Jan 8, 2025
Merged
Conversation
And also clean up code and fix eyes movement to match original This fix was proposed by eriktorbjorn in a previous PR scummvm#6383 (now closed in favor of this one). This prevents an overflow for int32 in Actor::getAngle() for the calculation of the "index" variable value, which would happen (before) when diffY would be >= 0x800000 (ie. 2^23) and was multiplied by 256 (ie. 2^8). This, in the context of the game's main menu would happen when moving the cursor to the top part of the screen. The code in getAngle() is also cleaned up to be more readable. An additional fix for the values of angleTable03[] is included, since previously it was populated by wrong hex values. What seems to have happened here was that the decimal values were wrongly entered as hex values by putting the "0x" prefix on the literal. This is a potential fix for bug ticket: https://bugs.scummvm.org/ticket/15658
Member
|
Appears to work fine. (Of course, I am slightly biased.) |
The angle unit is in degrees
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
And also clean up code and fix eyes movement to match original
This fix was proposed by @eriktorbjorn in a previous PR #6383 (now closed in favor of this one).
This prevents an overflow for int32 in Actor::getAngle() for the calculation of the "index" variable value, which would happen (before) when diffY would be >= 0x800000 (ie. 2^23) and was multiplied by 256 (ie. 2^8). This, in the context of the game's main menu would happen when moving the cursor to the top part of the screen.
The code in getAngle() is also cleaned up to be more readable.
An additional fix for the values of angleTable03[] is included, since previously it was populated by wrong hex values. What seems to have happened here was that the decimal values were wrongly entered as hex values by putting the "0x" prefix on the literal.
This is a potential fix for bug ticket: https://bugs.scummvm.org/ticket/15658