mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
Refactored variant constructor logic
This commit is contained in:
parent
593e35346a
commit
221a2a1742
33 changed files with 1369 additions and 571 deletions
|
@ -1431,7 +1431,7 @@ void VisualScriptConstant::set_constant_type(Variant::Type p_type) {
|
|||
|
||||
type = p_type;
|
||||
Callable::CallError ce;
|
||||
value = Variant::construct(type, nullptr, 0, ce);
|
||||
Variant::construct(type, value, nullptr, 0, ce);
|
||||
ports_changed_notify();
|
||||
_change_notify();
|
||||
}
|
||||
|
@ -3255,7 +3255,7 @@ 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) {
|
||||
Callable::CallError ce;
|
||||
*p_outputs[0] = Variant::construct(type, p_inputs, argcount, ce);
|
||||
Variant::construct(type, *p_outputs[0], p_inputs, argcount, ce);
|
||||
if (ce.error != Callable::CallError::CALL_OK) {
|
||||
r_error_str = "Invalid arguments for constructor";
|
||||
}
|
||||
|
@ -3727,7 +3727,7 @@ void VisualScriptDeconstruct::_update_elements() {
|
|||
elements.clear();
|
||||
Variant v;
|
||||
Callable::CallError ce;
|
||||
v = Variant::construct(type, nullptr, 0, ce);
|
||||
Variant::construct(type, v, nullptr, 0, ce);
|
||||
|
||||
List<PropertyInfo> pinfo;
|
||||
v.get_property_list(&pinfo);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue