summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-10-08 10:23:29 +0200
committerGitHub <noreply@github.com>2020-10-08 10:23:29 +0200
commit104cfaefcd11cfc30dedd53460593accab0d55cb (patch)
treee5c1ab301968b8375a1d5164cdb22454db4b7695 /modules
parent8a4f402bcb85ccbf713b76581a1960448f917695 (diff)
parentd76457a7f39cade4f0bccfc8c68eb1b1c5a59c44 (diff)
Merge pull request #42610 from jak6jak/set_values
Fixed a bug which caused Set Index to not function
Diffstat (limited to 'modules')
-rw-r--r--modules/visual_script/visual_script_nodes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index 1b77ed3168..28122ade99 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -1706,8 +1706,10 @@ public:
virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
bool valid;
+ // *p_output[0] points to the same place as *p_inputs[2] so we need a temp to store the value before the change in the next line
+ Variant temp = *p_inputs[2];
*p_outputs[0] = *p_inputs[0];
- p_outputs[0]->set(*p_inputs[1], *p_inputs[2], &valid);
+ p_outputs[0]->set(*p_inputs[1], temp, &valid);
if (!valid) {
r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;