You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
[4.3] Fix MSVC warning for potential mod by 0 (C4724)
(cherry picked from commit be2c9dec94)
This commit is contained in:
committed by
Thaddeus Crews
parent
b7a8819bd0
commit
6aa9a06346
@@ -63,8 +63,10 @@ void CollisionPolygon3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
|
||||
float depth = polygon->get_depth() * 0.5;
|
||||
|
||||
Vector<Vector3> lines;
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
int n = (i + 1) % points.size();
|
||||
const int points_size = points.size();
|
||||
|
||||
for (int i = 0; i < points_size; i++) {
|
||||
int n = (i + 1) % points_size;
|
||||
lines.push_back(Vector3(points[i].x, points[i].y, depth));
|
||||
lines.push_back(Vector3(points[n].x, points[n].y, depth));
|
||||
lines.push_back(Vector3(points[i].x, points[i].y, -depth));
|
||||
|
||||
Reference in New Issue
Block a user