mirror of
https://github.com/godotengine/godot.git
synced 2025-02-18 16:50:48 +00:00
Fix crash in Tileset with get_collision_polygon_shape
Shape index was used instead of polygon index in this one case.
This commit is contained in:
parent
795cd2eb38
commit
c29d3d0b17
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user