From e1e3e4b1577187876f9a85f5c75e5ee5c74325d1 Mon Sep 17 00:00:00 2001 From: Dan Brook Date: Fri, 15 Mar 2024 11:30:48 +0700 Subject: [PATCH] Change call from empty to is_empty in RNG tutorial The `empty` method was renamed to `is_empty` somewhere between 3.x and 4.x so the code in the tutorial just needed to be brought up to date. This was brought to light by someone in the Godot server on the #beginner-2 channel noticing an error when running that code: https://discord.com/channels/212250894228652034/762480166248513577/1218050947385786438 --- tutorials/math/random_number_generation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/math/random_number_generation.rst b/tutorials/math/random_number_generation.rst index 39efffca5..c28b05d1a 100644 --- a/tutorials/math/random_number_generation.rst +++ b/tutorials/math/random_number_generation.rst @@ -422,7 +422,7 @@ ends up empty. When that happens, you reinitialize it to its default value:: func get_fruit(): - if _fruits.empty(): + if _fruits.is_empty(): # Fill the fruits array again and shuffle it. _fruits = _fruits_full.duplicate() _fruits.shuffle()