From cc94a95fc9fe23a068da5cc8e3d345c450b502d5 Mon Sep 17 00:00:00 2001 From: Chaosus Date: Tue, 18 Jun 2019 07:53:41 +0300 Subject: Fix AStar set/is_point_disabled crash --- core/math/a_star.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/math') diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 0b6e9ae929..359446dde6 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -435,10 +435,16 @@ PoolVector AStar::get_id_path(int p_from_id, int p_to_id) { } void AStar::set_point_disabled(int p_id, bool p_disabled) { + + ERR_FAIL_COND(!points.has(p_id)); + points[p_id]->enabled = !p_disabled; } bool AStar::is_point_disabled(int p_id) const { + + ERR_FAIL_COND_V(!points.has(p_id), false); + return !points[p_id]->enabled; } -- cgit v1.2.3