diff options
Diffstat (limited to 'Project/MathExpression.cpp')
-rw-r--r-- | Project/MathExpression.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Project/MathExpression.cpp b/Project/MathExpression.cpp index f22b828..0577c32 100644 --- a/Project/MathExpression.cpp +++ b/Project/MathExpression.cpp @@ -175,7 +175,10 @@ bool MathExpression::Solve(double* input, double timeStep) for(auto itCN = nodeList.begin(), itCNEnd = nodeList.end(); itCN != itCNEnd; ++itCN) { Node* childNode = *itCN; if(childNode == node) { - m_inputValues[i] = cLine->GetValue(); + if(!cLine->IsSolved()) + m_inputValues[i] = 0.0; + else + m_inputValues[i] = cLine->GetValue(); break; } } @@ -328,7 +331,7 @@ bool MathExpression::Initialize() // Optimize only once to gain performance. m_fparser.Optimize(); - + m_solved = false; m_output = 0.0; return true; |