diff options
-rw-r--r-- | .mailmap | 1 | ||||
-rw-r--r-- | AUTHORS.md | 2 | ||||
-rw-r--r-- | DONORS.md | 2 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 11 |
4 files changed, 10 insertions, 6 deletions
@@ -18,6 +18,7 @@ Bastiaan Olij <mux213@gmail.com> Benjamin <mafortion.benjamin@gmail.com> Bernhard Liebl <Bernhard.Liebl@gmx.org> <poke1024@gmx.de> Bernhard Liebl <Bernhard.Liebl@gmx.org> <poke1024@gmx.org> +Bruno Lourenço <madequa@users.noreply.github.com> <bmlourenco@gmail.com> Chaosus <chaosus89@gmail.com> Chris Bradfield <chris@kidscancode.org> <cb@scribe.net> Clay John <claynjohn@gmail.com> diff --git a/AUTHORS.md b/AUTHORS.md index cbc5bd0762..8be2d05455 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -46,6 +46,7 @@ name is available. Bernard Liebl (poke1024) Błażej Szczygieł (zaps166) Bojidar Marinov (bojidar-bg) + Bruno Lourenço (MadEqua) bruvzg Cameron Reikes (creikey) Camille Mohr-Daurat (pouleyKetchoupp) @@ -65,6 +66,7 @@ name is available. Emmanuel Leblond (touilleMan) Eoin O'Neill (Eoin-ONeill-Yokai) Eric Lasota (elasota) + Eric Rybicki (ericrybick) Erik Selecký (rxlecky) est31 Fabian Mathews (supagu) @@ -322,7 +322,6 @@ generous deed immortalized in the next stable release of Godot Engine. Jako Danar James A F Manley Jannik Gröger - Jarrod Davis Jax Jeff Hungerford Jennifer Graves @@ -464,6 +463,7 @@ generous deed immortalized in the next stable release of Godot Engine. tiansheng li Tim Drumheller Timothy B. MacDonald + tinyBigGames LLC Tobbun Tom Fulp Tom Glenn diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index a107cb020d..f889228f87 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -627,13 +627,14 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era if (r != bucket_cache_rect) _clear_bucket_cache(); // Cache grid is not initialized - if (bucket_cache_visited == 0) { + if (bucket_cache_visited == NULL) { bucket_cache_visited = new bool[area]; invalidate_cache = true; } // Tile ID changed or position wasn't visited by the previous fill - int loc = (p_start.x - r.position.x) + (p_start.y - r.position.y) * r.get_size().x; - if (prev_id != bucket_cache_tile || !bucket_cache_visited[loc]) { + const int loc = (p_start.x - r.position.x) + (p_start.y - r.position.y) * r.get_size().x; + const bool in_range = 0 <= loc && loc < area; + if (prev_id != bucket_cache_tile || (in_range && !bucket_cache_visited[loc])) { invalidate_cache = true; } if (invalidate_cache) { @@ -893,7 +894,7 @@ void TileMapEditor::_draw_fill_preview(Control *p_viewport, int p_cell, const Po void TileMapEditor::_clear_bucket_cache() { if (bucket_cache_visited) { delete[] bucket_cache_visited; - bucket_cache_visited = 0; + bucket_cache_visited = NULL; } } @@ -1924,7 +1925,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { transpose = false; bucket_cache_tile = -1; - bucket_cache_visited = 0; + bucket_cache_visited = NULL; invalid_cell.resize(1); invalid_cell.write[0] = TileMap::INVALID_CELL; |