Fix polygon trying to solve center with fewer than 3 vertices. - #1429
GeneralProtectionFault wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Redot-Engine/redot-engine/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. Walkthrough
ChangesPolygon center calculation
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When adding a CollisionPolygon2D, the Output would spam:
ERROR: core/math/geometry_2d.cpp:110 - Convex decomposing failed!This would spam on mouse drag, etc... as well until there was an actual "polygon."
This just adds a guard to the _get_geometric_center() function which bails out if there are fewer than 3 vertices (and thus no polygon yet).
Summary by CodeRabbit