Browse Source

Merge pull request #106796 from akien-mga/tileset-compat-conversion-prevent-crash

TileSet: Prevent crash in conversion of invalid tiles from Godot 3.x
Thaddeus Crews 3 tháng trước cách đây
mục cha
commit
869807a7b8
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      scene/resources/2d/tile_set.cpp

+ 1 - 0
scene/resources/2d/tile_set.cpp

@@ -3509,6 +3509,7 @@ void TileSet::_compatibility_conversion() {
 							compatibility_tilemap_mapping_tile_modes[E.key] = COMPATIBILITY_TILE_MODE_ATLAS_TILE;
 							compatibility_tilemap_mapping_tile_modes[E.key] = COMPATIBILITY_TILE_MODE_ATLAS_TILE;
 
 
 							TileData *tile_data = atlas_source->get_tile_data(coords, alternative_tile);
 							TileData *tile_data = atlas_source->get_tile_data(coords, alternative_tile);
+							ERR_CONTINUE(!tile_data);
 
 
 							tile_data->set_flip_h(flip_h);
 							tile_data->set_flip_h(flip_h);
 							tile_data->set_flip_v(flip_v);
 							tile_data->set_flip_v(flip_v);