-
-
Notifications
You must be signed in to change notification settings - Fork 514
Squirrel Level.edit bug #207
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
Comments
The Scripting Reference is here, but it's not clear what this does. What are you trying to do? |
Allow the player to look around. |
I can't reproduce it. |
Program received signal EXC_BAD_ACCESS, Could not access memory. |
bug.stl.txt |
Can reproduce this from the switch, but not when running the same commands through the command line. |
No, that doesn't result in anything unusual. |
My initial assesement was wrong, ... if you seperate the two commands into two switches, the execution of the command |
I just fixed this bug, the error was, that when edit mode is left, a new level instance is created, and when the squirrel vm calls the closure the level is restarted, and the old level object is destroyed, thus the reference the vm has to the closure function is invalid, possibly when squirrel tries to clean up or something, it tries to access a destroyed object. The easy fix is/would be to have a reference to the level created before the now played level in the GameSession class, then everything works as exspected. Should I open a pr with this fix? |
Yes, please do open a PR, and we can take a look at it. |
Using the function Level.edit(false) through a switch when in edit mode currently causes the game to crash. This is due to the current Level object being destroyed when the edit mode is left, but squirrel is still referencing / trying to use it, and this leads to the seg fault. The Fix is, that the GameSession object keeps a reference to the last delteted level, as an extra member variable, thus squirrel can still access the level object. Fixes SuperTux#207
Using the function Level.edit(false) through a switch when in edit mode currently causes the game to crash. This is due to the current Level object being destroyed when the edit mode is left, but squirrel is still referencing / trying to use it, and this leads to the seg fault. The Fix is, that the GameSession object keeps a reference to the last delteted level, as an extra member variable, thus squirrel can still access the level object. Fixes SuperTux#207
Running Level.edit(true); then Level.edit(false); closes the game.
The text was updated successfully, but these errors were encountered: