diff options
author | Samuel Wilson <yokomeshi@gmail.com> | 2022-04-17 22:31:33 -0500 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2022-04-27 09:35:33 +0200 |
commit | a4c38aa92e942bba0a8f7f674b05875f45127b2e (patch) | |
tree | 38b62bd38960cc9151c59b3d6f4bad9c61031d0f /scene/2d | |
parent | e89fc52ec62c247c4d88e3592972426173bb24a7 (diff) |
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.
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/tile_map.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<TileMapPat TypedArray<Vector2i> 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])); } } |