Skip to content

Conversation

@PetrisGR
Copy link
Contributor

@PetrisGR PetrisGR commented Jul 3, 2023

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)

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)
@mkafrin
Copy link
Owner

mkafrin commented Aug 27, 2023

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 end

at the top of the method, instead of wrapping everything in the if. Other than that, it looks good! Thanks for making the adjustments btw.

@PetrisGR
Copy link
Contributor Author

No worries. That's a great suggestion to improve the readability of the script even if it's just a small if statement. I'm more than happy to help when it comes to scripts that are used & appreciated by many people. Hope it's good now!

Copy link
Owner

@mkafrin mkafrin left a 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!

@mkafrin mkafrin merged commit 9ff0d05 into mkafrin:master Aug 28, 2023
@PetrisGR PetrisGR deleted the patch-1 branch August 28, 2023 18:48
@DrAceMisanthrope
Copy link

When using /pzcreate box the debugPoly isn't drawing because of this update.

if not self.debugPoly and not self.debugGrid then return end

But changing it to include drawZone which is true while creating a zone, makes it work again.

if not self.debugPoly and not self.debugGrid and not drawZone then return end

I 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.

@mkafrin
Copy link
Owner

mkafrin commented Dec 3, 2023

Commented on #94, thanks for the catch.

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.

3 participants