summaryrefslogtreecommitdiff
path: root/servers/visual/visual_server_canvas.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-09 19:20:53 +0200
committerGitHub <noreply@github.com>2019-08-09 19:20:53 +0200
commitaaa55dfac12a79a7074bfd97c8ee2859bb1fbe53 (patch)
tree863c635081277814250bbca958ea6e74100ca65b /servers/visual/visual_server_canvas.cpp
parent7bb2215ed0d7415179a8b59ad4766a3b573cf696 (diff)
parent5ca74604217758d91e344b052fe87c9eda8940a9 (diff)
Merge pull request #31216 from YeldhamDev/err_msg_main_servers
Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "main" and "servers" directories
Diffstat (limited to 'servers/visual/visual_server_canvas.cpp')
-rw-r--r--servers/visual/visual_server_canvas.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index fc75fda583..f5a1276c27 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -386,8 +386,7 @@ void VisualServerCanvas::canvas_item_set_parent(RID p_item, RID p_parent) {
} else {
- ERR_EXPLAIN("Invalid parent");
- ERR_FAIL();
+ ERR_FAIL_MSG("Invalid parent.");
}
}
@@ -754,12 +753,7 @@ void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2
ERR_FAIL_COND(uv_size != 0 && (uv_size != pointcount));
#endif
Vector<int> indices = Geometry::triangulate_polygon(p_points);
-
- if (indices.empty()) {
-
- ERR_EXPLAIN("Bad Polygon!");
- ERR_FAIL();
- }
+ ERR_FAIL_COND_MSG(indices.empty(), "Invalid polygon data, triangulation failed.");
Item::CommandPolygon *polygon = memnew(Item::CommandPolygon);
ERR_FAIL_COND(!polygon);