godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Documentation: Out of Date Snippet in "GDScript reference" for Godot 4.2

Open TheJP opened this issue 2 years ago • 0 comments

Your Godot version: 4.2.1

Issue description: The GDScript reference for Godot 4.2 contains a code snippet that seems to be out of date.

In a call to Signal.connect an array is passed as second parameter, but the new signature of Signal.connect is int connect(callable: Callable, flags: int = 0). As far as I understand Callable.bind should be used instead (see suggestion bellow).

URL to the documentation page (if already existing): https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html#signals

Suggested Fix

Current Snippet: https://github.com/godotengine/godot-docs/blob/f0f255ff4053132049bcdb3d15492c6fc573c15f/tutorials/scripting/gdscript/gdscript_basics.rst?plain=1#L2336

Suggestion:

character_node.health_changed.connect(battle_log_node._on_Character_health_changed.bind(character_node.name))

TheJP avatar Apr 15 '24 14:04 TheJP