Merge pull request #12097 from rcurtis/issue12065

Visualscript: Fixes untouched value is null instead of 0
This commit is contained in:
Rémi Verschelde 2017-10-20 23:20:32 +02:00 committed by GitHub
commit bf88c3c8e8
2 changed files with 7 additions and 3 deletions

View File

@ -1280,6 +1280,11 @@ void VisualScriptBuiltinFunc::_bind_methods() {
BIND_ENUM_CONSTANT(FUNC_MAX);
}
VisualScriptBuiltinFunc::VisualScriptBuiltinFunc(VisualScriptBuiltinFunc::BuiltinFunc func) {
this->func = func;
}
VisualScriptBuiltinFunc::VisualScriptBuiltinFunc() {
func = MATH_SIN;
@ -1288,9 +1293,7 @@ VisualScriptBuiltinFunc::VisualScriptBuiltinFunc() {
template <VisualScriptBuiltinFunc::BuiltinFunc func>
static Ref<VisualScriptNode> create_builtin_func_node(const String &p_name) {
Ref<VisualScriptBuiltinFunc> node;
node.instance();
node->set_func(func);
Ref<VisualScriptBuiltinFunc> node = memnew(VisualScriptBuiltinFunc(func));
return node;
}

View File

@ -132,6 +132,7 @@ public:
virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
VisualScriptBuiltinFunc(VisualScriptBuiltinFunc::BuiltinFunc func);
VisualScriptBuiltinFunc();
};