Fix output port type mismatch for some VisualScript nodes

(cherry picked from commit dcacecaed0)
This commit is contained in:
Perrier Mathis 2021-07-31 23:17:24 +02:00 committed by Rémi Verschelde
parent ab5f3fcbe0
commit b5e4a3c3e0

View file

@ -518,10 +518,10 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
t = Variant::REAL; t = Variant::REAL;
} break; } break;
case MATH_ABS: { case MATH_ABS: {
t = Variant::NIL; t = Variant::REAL;
} break; } break;
case MATH_SIGN: { case MATH_SIGN: {
t = Variant::NIL; t = Variant::REAL;
} break; } break;
case MATH_POW: case MATH_POW:
case MATH_LOG: case MATH_LOG:
@ -547,7 +547,6 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
case MATH_MOVE_TOWARD: case MATH_MOVE_TOWARD:
case MATH_DECTIME: { case MATH_DECTIME: {
t = Variant::REAL; t = Variant::REAL;
} break; } break;
case MATH_RANDOMIZE: { case MATH_RANDOMIZE: {
} break; } break;
@ -584,34 +583,29 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
case LOGIC_MAX: case LOGIC_MAX:
case LOGIC_MIN: case LOGIC_MIN:
case LOGIC_CLAMP: { case LOGIC_CLAMP: {
t = Variant::REAL;
} break; } break;
case LOGIC_NEAREST_PO2: { case LOGIC_NEAREST_PO2: {
t = Variant::NIL; t = Variant::INT;
} break; } break;
case OBJ_WEAKREF: { case OBJ_WEAKREF: {
t = Variant::OBJECT; t = Variant::OBJECT;
} break; } break;
case FUNC_FUNCREF: { case FUNC_FUNCREF: {
t = Variant::OBJECT; t = Variant::OBJECT;
} break; } break;
case TYPE_CONVERT: { case TYPE_CONVERT: {
} break; } break;
case TEXT_ORD: case TEXT_ORD:
case TYPE_OF: { case TYPE_OF: {
t = Variant::INT; t = Variant::INT;
} break; } break;
case TYPE_EXISTS: { case TYPE_EXISTS: {
t = Variant::BOOL; t = Variant::BOOL;
} break; } break;
case TEXT_CHAR: case TEXT_CHAR:
case TEXT_STR: { case TEXT_STR: {
t = Variant::STRING; t = Variant::STRING;
} break; } break;
case TEXT_PRINT: { case TEXT_PRINT: {
} break; } break;
@ -630,7 +624,6 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons
} else { } else {
t = Variant::BOOL; t = Variant::BOOL;
} }
} break; } break;
case BYTES_TO_VAR: { case BYTES_TO_VAR: {
if (p_idx == 1) { if (p_idx == 1) {
@ -1218,10 +1211,6 @@ public:
VisualScriptBuiltinFunc::BuiltinFunc func; VisualScriptBuiltinFunc::BuiltinFunc func;
//virtual int get_working_memory_size() const { return 0; }
//virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
//virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return true; }
virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) { virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
VisualScriptBuiltinFunc::exec_func(func, p_inputs, p_outputs[0], r_error, r_error_str); VisualScriptBuiltinFunc::exec_func(func, p_inputs, p_outputs[0], r_error, r_error_str);
return 0; return 0;