summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-14 20:26:40 +0200
committerGitHub <noreply@github.com>2021-10-14 20:26:40 +0200
commit668ceda9cb3463dfba32a0487304a75b0d84a066 (patch)
tree65ad3b9282e75e7bb1da40eb50e5c84998e0c9b7 /scene/resources
parent57478950020f53d6a5d2f74ecbb9fdcf107ee9ac (diff)
parent3948f9cc83aa96556f24e2576aceb84d40e2774a (diff)
Merge pull request #53810 from groud/fix_crash
Fixes crash in TileSetAtlasSource::get_tiles_to_be_removed_on_change
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/tile_set.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 275b430f2a..b988b2ab3e 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -3565,6 +3565,10 @@ bool TileSetAtlasSource::has_room_for_tile(Vector2i p_atlas_coords, Vector2i p_s
}
PackedVector2Array TileSetAtlasSource::get_tiles_to_be_removed_on_change(Ref<Texture2D> p_texture, Vector2i p_margins, Vector2i p_separation, Vector2i p_texture_region_size) {
+ ERR_FAIL_COND_V(p_margins.x < 0 || p_margins.y < 0, PackedVector2Array());
+ ERR_FAIL_COND_V(p_separation.x < 0 || p_separation.y < 0, PackedVector2Array());
+ ERR_FAIL_COND_V(p_texture_region_size.x <= 0 || p_texture_region_size.y <= 0, PackedVector2Array());
+
// Compute the new atlas grid size.
Size2 new_grid_size;
if (p_texture.is_valid()) {