summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorGilles Roudière <gilles.roudiere@gmail.com>2021-11-03 09:11:37 +0100
committerGitHub <noreply@github.com>2021-11-03 09:11:37 +0100
commit8f308bec25ac247ad2ac8b753a1d0558903b6dda (patch)
treeb2872de99967088e435d8ac91941f1f6a22fb9f3 /scene
parentaf80bc8abecc30c77901967281679e380fb9f952 (diff)
parentc29d3d0b17d67495459c018679b719258428972e (diff)
Merge pull request #54528 from nekomatata/fix-crash-tileset-polygon
Fix crash in Tileset with get_collision_polygon_shape
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/tile_set.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index d036ae2b62..9306d19520 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -4946,8 +4946,8 @@ int TileData::get_collision_polygon_shapes_count(int p_layer_id, int p_polygon_i
Ref<ConvexPolygonShape2D> TileData::get_collision_polygon_shape(int p_layer_id, int p_polygon_index, int shape_index) const {
ERR_FAIL_INDEX_V(p_layer_id, physics.size(), 0);
ERR_FAIL_INDEX_V(p_polygon_index, physics[p_layer_id].polygons.size(), Ref<ConvexPolygonShape2D>());
- ERR_FAIL_INDEX_V(shape_index, (int)physics[p_layer_id].polygons[shape_index].shapes.size(), Ref<ConvexPolygonShape2D>());
- return physics[p_layer_id].polygons[shape_index].shapes[shape_index];
+ ERR_FAIL_INDEX_V(shape_index, (int)physics[p_layer_id].polygons[p_polygon_index].shapes.size(), Ref<ConvexPolygonShape2D>());
+ return physics[p_layer_id].polygons[p_polygon_index].shapes[shape_index];
}
// Terrain