aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/ifnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/ifnode.cpp')
-rw-r--r--node/ifnode.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/node/ifnode.cpp b/node/ifnode.cpp
index 27b588f..91ad199 100644
--- a/node/ifnode.cpp
+++ b/node/ifnode.cpp
@@ -81,7 +81,7 @@ void IfNode::run(ExecutionNode *previous)
}
}
}
- else
+ else if((m_conditionType == OneOfThem)||(m_conditionType == AllOfThem))
{
bool trueForAll=true;
bool falseForAll=true;
@@ -133,28 +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
{
- Die* dice = new Die();
- dice->setValue(value);
- dice->setMaxValue(value);
- if(m_validator->hasValid(dice,true,true))
- {
- nextNode=m_true;
- }
- else
- {
- nextNode=m_false;
- }
- if(NULL!=nextNode)
+ nextNode=m_false;
+ }
+ if(NULL!=nextNode)
+ {
+ if(NULL==m_nextNode)
{
- if(NULL==m_nextNode)
- {
- m_nextNode = nextNode;
- }
- nextNode->run(previousLoop);
- previousLoop = getLeafNode(nextNode);
+ m_nextNode = nextNode;
}
+ nextNode->run(previousLoop);
+ previousLoop = getLeafNode(nextNode);
}
}
}