diff options
| author | 2019-07-19 02:01:06 +0200 | |
|---|---|---|
| committer | 2019-07-19 02:01:06 +0200 | |
| commit | 63edd55e030475bd4abe1f39967cacf6e5adf892 (patch) | |
| tree | 3857f7e75b5dc60c0b9b6e26504584a893468ce2 /node/ifnode.cpp | |
| parent | 504d91db102a840e461b8b2ba442c0f76d581742 (diff) | |
| download | OneRoll-63edd55e030475bd4abe1f39967cacf6e5adf892.tar.gz OneRoll-63edd55e030475bd4abe1f39967cacf6e5adf892.zip | |
fix if behaviour and output
Diffstat (limited to 'node/ifnode.cpp')
| -rw-r--r-- | node/ifnode.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/node/ifnode.cpp b/node/ifnode.cpp index fbcd9b9..5470e15 100644 --- a/node/ifnode.cpp +++ b/node/ifnode.cpp @@ -133,30 +133,30 @@ void IfNode::run(ExecutionNode* previous) } } } - } - - if(m_conditionType == OnScalar) - { - Die* dice= new Die(); - dice->setValue(value); - dice->insertRollValue(value); - dice->setMaxValue(value); - if(m_validator->hasValid(dice, true, true)) - { - nextNode= m_true; - } - else - { - nextNode= m_false; - } - if(nullptr != nextNode) + if(m_conditionType == OnScalar) { - if(nullptr == m_nextNode) + Die dice; + auto val= static_cast<qint64>(value); + dice.setValue(val); + dice.insertRollValue(val); + dice.setMaxValue(val); + if(m_validator->hasValid(&dice, true, true)) { - m_nextNode= nextNode; + nextNode= m_true; + } + else + { + nextNode= m_false; + } + if(nullptr != nextNode) + { + if(nullptr == m_nextNode) + { + m_nextNode= nextNode; + } + nextNode->run(previousLoop); + previousLoop= getLeafNode(nextNode); } - nextNode->run(previousLoop); - previousLoop= getLeafNode(nextNode); } } } |