summaryrefslogtreecommitdiff
path: root/modules/csg
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2019-06-20 16:59:48 +0200
committerqarmin <mikrutrafal54@gmail.com>2019-06-20 16:59:48 +0200
commit072e40368e19e0f88ec1fbb61fe463a6fffcca36 (patch)
tree2a5c9383550dc22392bb210d5be570e1baa33fe2 /modules/csg
parent7a8dcb9a114d742f9bc1e269d738903c00729b8b (diff)
Fix always true/false values
Diffstat (limited to 'modules/csg')
-rw-r--r--modules/csg/csg.cpp8
-rw-r--r--modules/csg/csg_shape.cpp8
2 files changed, 7 insertions, 9 deletions
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp
index 3a61afa023..3db1f9e3e0 100644
--- a/modules/csg/csg.cpp
+++ b/modules/csg/csg.cpp
@@ -1018,15 +1018,15 @@ int CSGBrushOperation::MeshMerge::_create_bvh(BVH *p_bvh, BVH **p_bb, int p_from
max_depth = p_depth;
}
- if (p_size <= BVH_LIMIT) {
+ if (p_size == 0) {
+
+ return -1;
+ } else if (p_size <= BVH_LIMIT) {
for (int i = 0; i < p_size - 1; i++) {
p_bb[p_from + i]->next = p_bb[p_from + i + 1] - p_bvh;
}
return p_bb[p_from] - p_bvh;
- } else if (p_size == 0) {
-
- return -1;
}
AABB aabb;
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 1d27b9b6f4..a496a214fd 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -1816,11 +1816,9 @@ CSGBrush *CSGPolygon::_build_brush() {
path_cache = path;
- if (path_cache) {
- path_cache->connect("tree_exited", this, "_path_exited");
- path_cache->connect("curve_changed", this, "_path_changed");
- path_cache = NULL;
- }
+ path_cache->connect("tree_exited", this, "_path_exited");
+ path_cache->connect("curve_changed", this, "_path_changed");
+ path_cache = NULL;
}
curve = path->get_curve();
if (curve.is_null())