浏览代码

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
Dan Brook 1 年之前
父节点
当前提交
e1e3e4b157
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tutorials/math/random_number_generation.rst

+ 1 - 1
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()