aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/keepdiceexecnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/keepdiceexecnode.cpp')
-rw-r--r--node/keepdiceexecnode.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp
index 355a63a..6167632 100644
--- a/node/keepdiceexecnode.cpp
+++ b/node/keepdiceexecnode.cpp
@@ -36,20 +36,20 @@ KeepDiceExecNode::~KeepDiceExecNode()
void KeepDiceExecNode::run(ExecutionNode* previous)
{
m_previousNode = previous;
- if(nullptr==previous)
+ if(NULL==previous)
{
return;
}
DiceResult* previousDiceResult = static_cast<DiceResult*>(previous->getResult());
m_result->setPrevious(previousDiceResult);
- if(nullptr!=previousDiceResult)
+ if(NULL!=previousDiceResult)
{
QList<Die*> diceList=previousDiceResult->getResultList();
QList<Die*> diceList3= diceList.mid(0,m_numberOfDice);
QList<Die*> diceList2;
- for(Die* die:diceList3)
+ foreach(Die* die,diceList3)
{
Die* tmpdie = new Die();
*tmpdie=*die;
@@ -70,7 +70,7 @@ void KeepDiceExecNode::run(ExecutionNode* previous)
}
m_diceResult->setResultList(diceList2);
- if(nullptr!=m_nextNode)
+ if(NULL!=m_nextNode)
{
m_nextNode->run(this);
}
@@ -96,8 +96,10 @@ qint64 KeepDiceExecNode::getPriority() const
qint64 priority=0;
if(nullptr!=m_previousNode)
{
- priority = m_previousNode->getPriority();
+ priority = m_nextNode->getPriority();
}
+
+
return priority;
}
@@ -105,7 +107,7 @@ ExecutionNode* KeepDiceExecNode::getCopy() const
{
KeepDiceExecNode* node = new KeepDiceExecNode();
node->setDiceKeepNumber(m_numberOfDice);
- if(nullptr!=m_nextNode)
+ if(NULL!=m_nextNode)
{
node->setNextNode(m_nextNode->getCopy());
}