-
Notifications
You must be signed in to change notification settings - Fork 80
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
Diggy mask debug surface bug #1039
base: develop
Are you sure you want to change the base?
Diggy mask debug surface bug #1039
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this change, but received an error that there was an attempt to index surface (nil value). No error if I check surface first then if not nil, check surface.valid. However, I think the code that displays the mask only executes once early on. So if the surface isn't ready yet, it never displays? I think the call to display the mask might still need to be relocated, but not sure where. In a temp fix I did, I displayed right after the first mined rock message for user pops up, but is there a way to call the function when the surface is ready and user first gains control?
Weird. The new code snippet should return if the surface is nil, and only try to index the .valid field if the surface isn’t nil. |
Still concerned that even with the surface check the code gets blocked the one time it tries to run. Curious Simon what you think about this: Within diggy_cave_collapse.lua the code that prints the mask is:
It is currently located in a function that does config registration and sets up events but think it is trying run before the diggy surface is setup. However, I also noticed that diggy_cave_collapse does have some code to check for the event, on_surface_created and a handler for it. |
Prevents the print_grid_value function from producing an error when surface is nil or invalid.
The Mask debugging setting may, or may not work. I'm simply not sure what it is supposed to do.
closes #1037
Ideally we would have to make sure the mask debugging works, before merging this PR