Skip to content

Commit

Permalink
GH-648 Permit any output to connect to boolean input
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Aug 7, 2024
1 parent 4166b9e commit 15779b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/script/node_pin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ bool OScriptNodePin::can_accept(const Ref<OScriptNodePin>& p_pin) const
if ((!is_execution() && p_pin->is_execution()) || (is_execution() && !p_pin->is_execution()))
return false;

// Any pin can connect to a Boolean input pin.
if (_property.type == Variant::BOOL)
return true;

// Types match
if (_property.type == p_pin->get_type())
{
Expand Down Expand Up @@ -530,10 +534,6 @@ bool OScriptNodePin::can_accept(const Ref<OScriptNodePin>& p_pin) const
if (PropertyUtils::is_variant(_property) || PropertyUtils::is_variant(p_pin->get_property_info()))
return true;

// Allow Object to boolean for conditional tests
if (_property.type == Variant::BOOL && p_pin->get_property_info().type == Variant::OBJECT)
return true;

return false;
}

Expand Down

0 comments on commit 15779b8

Please sign in to comment.