mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 20:23:53 +00:00
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:
parent
e89fc52ec6
commit
a4c38aa92e
@ -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]));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user