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

Call cancelAnimationFrame on game end/crash #508

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Toad06
Copy link
Contributor

@Toad06 Toad06 commented Jun 6, 2024

  • Fixed the case where any error occurring before the game reached its final state would prevent the initialisation from proceeding to the next step (g_StartUpState variable). Consequently, the same error-inducing code would execute at each requestAnimationFrame call.

Basically, a code snippet like this in a Create Event in the first room of the game would show the message endlessly:

show_message("test");
var a = "c";
var b = a + 1; // error

This is likely related to YoYoGames/GameMaker-Bugs#4726, but I'm attaching another sample here.

  • The previous change also fixed the very unlikely case where managing to call game_restart, room_goto or similar after a game end/crash would work.

These changes only work on browsers that support requestAnimation / cancelAnimationFrame, which should be fine since the browser vendors implemented these features more than a decade ago. The only affected browser is Opera Mini but I'm not sure GameMaker would run on it at all since it lacks so many features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants