From aca8176341401da38a015775e5b0560ce93b2000 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Thu, 31 Jan 2019 11:48:37 +0200 Subject: [PATCH] Fix crashes when calling update_bitmask_area Fixes #25504 (cherry picked from commit abfeba8d123a4a1653a03c0387fd0335219fe428) --- scene/resources/tile_set.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index ee85242971f..9e7847b6058 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -525,7 +525,7 @@ Vector2 TileSet::autotile_get_subtile_for_bitmask(int p_id, uint16_t p_bitmask, if (coords.size() == 0) { return autotile_get_icon_coordinate(p_id); } else { - return coords[Math::random(0, (int)coords.size())]; + return coords[Math::rand() % coords.size()]; } }