Fix Multiply (and similar) nodes result value in Visject if the first input is disconnected

This commit is contained in:
Wojciech Figat
2022-03-28 19:48:08 +02:00
parent 95e90d5c37
commit f10af9d8fb
2 changed files with 11 additions and 2 deletions

View File

@@ -156,6 +156,10 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value)
Box* b2 = node->GetBox(1);
Value v1 = tryGetValue(b1, 0, Value::Zero);
Value v2 = tryGetValue(b2, 1, Value::Zero);
if (b1->HasConnection())
v2 = v2.Cast(v1.Type);
else
v1 = v1.Cast(v2.Type);
Char op = '?';
switch (node->TypeID)
{