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.
This commit is contained in:
Samuel Wilson 2022-04-17 22:31:33 -05:00 committed by Rémi Verschelde
parent e89fc52ec6
commit a4c38aa92e

View File

@ -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]));
}
}