From abfeba8d123a4a1653a03c0387fd0335219fe428 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 --- 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 5a2e7245a22..3c83de91fdf 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -614,7 +614,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()]; } }