Merge pull request #77440 from KoBeWi/set_pattern_which_doesn't_exist
Check for null in `set_pattern()`
This commit is contained in:
commit
4c677c88e9
1 changed files with 2 additions and 1 deletions
|
@ -2334,7 +2334,8 @@ Vector2i TileMap::map_pattern(const Vector2i &p_position_in_tilemap, const Vecto
|
|||
|
||||
void TileMap::set_pattern(int p_layer, const Vector2i &p_position, const Ref<TileMapPattern> p_pattern) {
|
||||
ERR_FAIL_INDEX(p_layer, (int)layers.size());
|
||||
ERR_FAIL_COND(!tile_set.is_valid());
|
||||
ERR_FAIL_COND(tile_set.is_null());
|
||||
ERR_FAIL_COND(p_pattern.is_null());
|
||||
|
||||
TypedArray<Vector2i> used_cells = p_pattern->get_used_cells();
|
||||
for (int i = 0; i < used_cells.size(); i++) {
|
||||
|
|
Loading…
Reference in a new issue