Merge pull request #51185 from timothyqiu/tile-data-enum-range

Validate TileData enum range before using it as index
This commit is contained in:
Rémi Verschelde 2021-08-02 17:20:44 +02:00 committed by GitHub
commit 2db45b62c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {