-
Notifications
You must be signed in to change notification settings - Fork 196
Fix: debugPoly state refresh on metatable update
#83
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
Conversation
This fix will help people who use debugPoly on their zones to optimize their Polyzones with distance checks. Previously if you tried the example below, debug lines would still be drawn in each frame. ClientData.CurrentZone.debugPoly = false PolyZone.ensureMetatable(ClientData.CurrentZone)
|
Last thing (sorry didn't think of it until now): This is mainly a style/preference thing, but can you change this to an early return instead? It would keep the indentation low and make the diff much nicer and more readable. Just if not self.debugPoly and not self.debugGrid then return endat the top of the method, instead of wrapping everything in the if. Other than that, it looks good! Thanks for making the adjustments btw. |
|
No worries. That's a great suggestion to improve the readability of the script even if it's just a small |
mkafrin
left a comment
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.
Looks good. Thanks for the contribution and updating based on feedback!
|
When using if not self.debugPoly and not self.debugGrid then return endBut changing it to include if not self.debugPoly and not self.debugGrid and not drawZone then return endI am sure there is a better fix which allows debugPoly to be visible when creating a zone, independent of other's debugPoly and debugGrid settings. However this change will help people currently having the issue of being unable to see the box zones they are creating. |
|
Commented on #94, thanks for the catch. |
This fix will help people who use debugPoly on their zones to optimize their Polyzones with distance checks. Previously if you tried the example below, debug lines would still be drawn in each frame.
ClientData.CurrentZone.debugPoly = false
PolyZone.ensureMetatable(ClientData.CurrentZone)