diff options
author | George Marques <george@gmarqu.es> | 2021-09-21 16:23:42 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2021-10-04 14:09:54 -0300 |
commit | 84956fee4bd83ef8af74efad7190fc4bbe161c5f (patch) | |
tree | c0d1ae3bf27d9706f76de85105853b02c167d86f /modules/gdscript/tests/scripts/runtime/features | |
parent | adc9500e5497c7427f91d7cbf9985f74cbb3451c (diff) |
GDScript: Fix member assignment with operation
It was wrongly updating the assigned value with the result of the
operation.
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime/features')
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.gd | 13 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/assign_member_with_operation.out | 5 |
2 files changed, 18 insertions, 0 deletions
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 |