瀏覽代碼

Line2D::set_point_position Fail if passed index is out of bounds

(cherry picked from commit df49fdd189185c034ccb573a9aed0bd1c55c08d8)
kleonc 4 年之前
父節點
當前提交
bd7c24371d
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      scene/2d/line_2d.cpp

+ 1 - 0
scene/2d/line_2d.cpp

@@ -123,6 +123,7 @@ PoolVector<Vector2> Line2D::get_points() const {
 }
 
 void Line2D::set_point_position(int i, Vector2 p_pos) {
+	ERR_FAIL_INDEX(i, _points.size());
 	_points.set(i, p_pos);
 	update();
 }