Merge pull request #29862 from Chaosus/fix_astar_crash

Fix AStar set/is_point_disabled crash
This commit is contained in:
Yuri Roubinsky 2019-06-18 08:18:23 +03:00 committed by GitHub
commit 3caed76eda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}