diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-17 11:43:15 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-17 11:43:15 +0200 |
commit | aefd91ae423f16174792014029948bab71fabff0 (patch) | |
tree | 5aa4d0934a0e7e915410b08dcb1d48591622f56f /modules/gdscript/tests/scripts | |
parent | 69a8aed59a93ffdca20cb5b6b0f3e72dae861701 (diff) | |
parent | 87c90a573c26ddcbe1b5d9f523b57a89d76dc6df (diff) | |
download | redot-engine-aefd91ae423f16174792014029948bab71fabff0.tar.gz |
Merge pull request #94138 from vnen/gdscript-simple-setter-chain-call-setter
GDScript: Call setter on simple setter chain without getter
Diffstat (limited to 'modules/gdscript/tests/scripts')
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.gd | 13 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.out | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.gd b/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.gd new file mode 100644 index 0000000000..9e27a500bf --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.gd @@ -0,0 +1,13 @@ +# https://github.com/godotengine/godot/issues/85952 + +var vec: Vector2 = Vector2.ZERO: + set(new_vec): + prints("setting vec from", vec, "to", new_vec) + if new_vec == Vector2(1, 1): + vec = new_vec + +func test(): + vec.x = 2 + vec.y = 2 + + prints("vec is", vec) diff --git a/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.out b/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.out new file mode 100644 index 0000000000..31b3b3a3a8 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.out @@ -0,0 +1,4 @@ +GDTEST_OK +setting vec from (0, 0) to (2, 0) +setting vec from (0, 0) to (0, 2) +vec is (0, 0) |