summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorChaosus <chaosus89@gmail.com>2019-06-18 07:53:41 +0300
committerChaosus <chaosus89@gmail.com>2019-06-18 08:02:41 +0300
commitcc94a95fc9fe23a068da5cc8e3d345c450b502d5 (patch)
tree94758a83eaeacc24593607120e1ef95a4f963a2c /core
parent9d3342545d39b71d70b2d9e812a22743c473089a (diff)
Fix AStar set/is_point_disabled crash
Diffstat (limited to 'core')
-rw-r--r--core/math/a_star.cpp6
1 files changed, 6 insertions, 0 deletions
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<int> 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;
}