summaryrefslogtreecommitdiff
path: root/scene/resources/tile_set.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-08-02 17:20:44 +0200
committerGitHub <noreply@github.com>2021-08-02 17:20:44 +0200
commit2db45b62c0a4aaac11852a6f2183d3bf7db935ba (patch)
tree4148f015b1b4ba032d4ae8fdd2c8f3e80732a556 /scene/resources/tile_set.cpp
parent5360c2012c01d1bc6e3a8aba731eae76bee0479c (diff)
parent091d8026926875cb6e50ea45f7661a16fd6af6f3 (diff)
Merge pull request #51185 from timothyqiu/tile-data-enum-range
Validate TileData enum range before using it as index
Diffstat (limited to 'scene/resources/tile_set.cpp')
-rw-r--r--scene/resources/tile_set.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 8206385682..fcd31143a8 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -3789,6 +3789,7 @@ int TileData::get_terrain_set() const {
}
void TileData::set_peering_bit_terrain(TileSet::CellNeighbor p_peering_bit, int p_terrain_index) {
+ ERR_FAIL_INDEX(p_peering_bit, TileSet::CellNeighbor::CELL_NEIGHBOR_MAX);
ERR_FAIL_COND(terrain_set < 0);
ERR_FAIL_COND(p_terrain_index < -1);
if (tile_set) {