From 5ca74604217758d91e344b052fe87c9eda8940a9 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Thu, 8 Aug 2019 17:08:27 -0300 Subject: Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "main" and "servers" directories --- servers/visual/visual_server_canvas.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'servers/visual/visual_server_canvas.cpp') 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 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); -- cgit v1.2.3