From 84956fee4bd83ef8af74efad7190fc4bbe161c5f Mon Sep 17 00:00:00 2001 From: George Marques Date: Tue, 21 Sep 2021 16:23:42 -0300 Subject: GDScript: Fix member assignment with operation It was wrongly updating the assigned value with the result of the operation. --- .../runtime/features/assign_member_with_operation.gd | 13 +++++++++++++ .../runtime/features/assign_member_with_operation.out | 5 +++++ 2 files changed, 18 insertions(+) create mode 100644 modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.out (limited to 'modules/gdscript/tests/scripts/runtime/features') diff --git a/modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.gd b/modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.gd new file mode 100644 index 0000000000..f6526aefb4 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.gd @@ -0,0 +1,13 @@ +extends Node + +func test(): + process_priority = 10 + var change = 20 + + print(process_priority) + print(change) + + process_priority += change + + print(process_priority) + print(change) diff --git a/modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.out b/modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.out new file mode 100644 index 0000000000..c9e6b34c77 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.out @@ -0,0 +1,5 @@ +GDTEST_OK +10 +20 +30 +20 -- cgit v1.2.3