mirror of
https://github.com/godotengine/godot.git
synced 2024-11-15 08:32:54 +00:00
Fix crash when executing TileMap.map_pattern
Validates the input reference.
This commit is contained in:
parent
b0e93711b3
commit
1078c389f9
@ -2104,6 +2104,7 @@ Ref<TileMapPattern> TileMap::get_pattern(int p_layer, TypedArray<Vector2i> p_coo
|
||||
}
|
||||
|
||||
Vector2i TileMap::map_pattern(Vector2i p_position_in_tilemap, Vector2i p_coords_in_pattern, Ref<TileMapPattern> p_pattern) {
|
||||
ERR_FAIL_COND_V(p_pattern.is_null(), Vector2i());
|
||||
ERR_FAIL_COND_V(!p_pattern->has_cell(p_coords_in_pattern), Vector2i());
|
||||
|
||||
Vector2i output = p_position_in_tilemap + p_coords_in_pattern;
|
||||
|
Loading…
Reference in New Issue
Block a user