Merge pull request #92373 from libklein/fix-caching-wrong-collision-layer-shapes

Fix TileSet caching wrong collision layer shapes for shapes comprising several polygons.
This commit is contained in:
Rémi Verschelde 2024-05-28 15:49:44 +02:00
commit 93596abcf5
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -6378,7 +6378,7 @@ Ref<ConvexPolygonShape2D> TileData::get_collision_polygon_shape(int p_layer_id,
for (int i = 0; i < size; i++) {
Ref<ConvexPolygonShape2D> transformed_polygon;
transformed_polygon.instantiate();
transformed_polygon->set_points(get_transformed_vertices(shapes_data.shapes[shape_index]->get_points(), p_flip_h, p_flip_v, p_transpose));
transformed_polygon->set_points(get_transformed_vertices(shapes_data.shapes[i]->get_points(), p_flip_h, p_flip_v, p_transpose));
shapes_data.transformed_shapes[key][i] = transformed_polygon;
}
return shapes_data.transformed_shapes[key][shape_index];