aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/ifnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/ifnode.cpp')
-rw-r--r--node/ifnode.cpp42
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);
}
}
}