summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
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;
}