From 6cbafdea163e96ef81df33f1ed7451484c535f43 Mon Sep 17 00:00:00 2001 From: James Beedie Date: Fri, 1 Jun 2018 17:12:25 -0400 Subject: Added autotile override --- scene/2d/tile_map.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scene') diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index d88e148b2..050a3f245 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -977,6 +977,14 @@ void TileMap::set_cell_autotile_coord(int p_x, int p_y, const Vector2 &p_coord) c.autotile_coord_x = p_coord.x; c.autotile_coord_y = p_coord.y; tile_map[pk] = c; + + PosKey qk(p_x / _get_quadrant_size(), p_y / _get_quadrant_size()); + Map::Element *Q = quadrant_map.find(qk); + + if (!Q) + return; + + _make_quadrant_dirty(Q); } Vector2 TileMap::get_cell_autotile_coord(int p_x, int p_y) const { -- cgit v1.2.3-70-g09d2