Fix issues with custom nodes in visual script

- Doesn't crash anymore.
- Inputs are properly transferred.
This commit is contained in:
George Marques 2017-07-21 00:05:56 -03:00
parent 2a0c0db028
commit 3fdf8663f7
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D
1 changed files with 4 additions and 3 deletions

View File

@ -29,10 +29,10 @@
/*************************************************************************/ /*************************************************************************/
#include "visual_script_nodes.h" #include "visual_script_nodes.h"
#include "project_settings.h"
#include "global_constants.h" #include "global_constants.h"
#include "os/input.h" #include "os/input.h"
#include "os/os.h" #include "os/os.h"
#include "project_settings.h"
#include "scene/main/node.h" #include "scene/main/node.h"
#include "scene/main/scene_tree.h" #include "scene/main/scene_tree.h"
@ -2596,10 +2596,10 @@ public:
in_values.resize(in_count); in_values.resize(in_count);
for (int i = 0; i < in_count; i++) { for (int i = 0; i < in_count; i++) {
in_values[i] = p_inputs[i]; in_values[i] = *p_inputs[i];
} }
out_values.resize(in_count); out_values.resize(out_count);
work_mem.resize(work_mem_size); work_mem.resize(work_mem_size);
@ -2645,6 +2645,7 @@ VisualScriptNodeInstance *VisualScriptCustomNode::instance(VisualScriptInstance
VisualScriptNodeInstanceCustomNode *instance = memnew(VisualScriptNodeInstanceCustomNode); VisualScriptNodeInstanceCustomNode *instance = memnew(VisualScriptNodeInstanceCustomNode);
instance->instance = p_instance; instance->instance = p_instance;
instance->node = this;
instance->in_count = get_input_value_port_count(); instance->in_count = get_input_value_port_count();
instance->out_count = get_output_value_port_count(); instance->out_count = get_output_value_port_count();