From a4c38aa92e942bba0a8f7f674b05875f45127b2e Mon Sep 17 00:00:00 2001 From: Samuel Wilson Date: Sun, 17 Apr 2022 22:31:33 -0500 Subject: Fix TileMap::set_pattern offsets Currently it is trying to use the target coordinates (i.e., in the destination TileMap) to pull from the pattern, rather than the pattern-local coordinates. --- scene/2d/tile_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/2d') diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index cbbadf1178..85cea0d915 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -2143,7 +2143,7 @@ void TileMap::set_pattern(int p_layer, Vector2i p_position, const Ref used_cells = p_pattern->get_used_cells(); for (int i = 0; i < used_cells.size(); i++) { Vector2i coords = map_pattern(p_position, used_cells[i], p_pattern); - set_cell(p_layer, coords, p_pattern->get_cell_source_id(coords), p_pattern->get_cell_atlas_coords(coords), p_pattern->get_cell_alternative_tile(coords)); + set_cell(p_layer, coords, p_pattern->get_cell_source_id(used_cells[i]), p_pattern->get_cell_atlas_coords(used_cells[i]), p_pattern->get_cell_alternative_tile(used_cells[i])); } } -- cgit v1.2.3