geode-sdk / DevTools

Browser-like Developer Tools for Geode
MIT License
13 stars 25 forks source link

Fix crash when controller stick is held on startup #19

Closed Cvolton closed 1 year ago

Cvolton commented 1 year ago

This PR fixes an issue where the game crashes on startup, if the right controller thumbstick is held during that time.

This crash occurs because the CCMouseDispatcher hook attempts to send the mouse wheel event to ImGui before it is initialized. This PR simply adds a check that prevents this from happening before DevTools is initialized.

One thing I am not sure about is whether the code in this PR matches the code style used in the mod. If it doesn't then feel free to use this just as a starting point for the idea of how to implement a fix for the issue, the code in the PR is verified to be fully working.

i wasted half an hour just staring at an error message because of this issue

altalk23 commented 1 year ago

very believable code