mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Merge pull request #84181 from jsjtxietian/fix-FastNoiseLite.get_image-crash
Fix `FastNoiseLite.get_image` crashes with bad param
This commit is contained in:
commit
5dc10b5aa5
@ -166,6 +166,9 @@ Vector<Ref<Image>> Noise::_get_image(int p_width, int p_height, int p_depth, boo
|
||||
|
||||
Ref<Image> Noise::get_image(int p_width, int p_height, bool p_invert, bool p_in_3d_space, bool p_normalize) const {
|
||||
Vector<Ref<Image>> images = _get_image(p_width, p_height, 1, p_invert, p_in_3d_space, p_normalize);
|
||||
if (images.is_empty()) {
|
||||
return Ref<Image>();
|
||||
}
|
||||
return images[0];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user