diff options
| author | 2017-11-23 17:26:13 +0100 | |
|---|---|---|
| committer | 2017-11-23 17:26:13 +0100 | |
| commit | 4eac628e2a9eadb08e2c9e673a6f41aea7a58205 (patch) | |
| tree | c32dc378d1f4f0fbfcfd5115d67b1d375f861fa4 /node/keepdiceexecnode.cpp | |
| parent | 95db07d62e7f9808ce3ed42335c5175db0f10f11 (diff) | |
| parent | ddf524d6f0de517551d21e73b81abdf724a9ca35 (diff) | |
| download | OneRoll-4eac628e2a9eadb08e2c9e673a6f41aea7a58205.tar.gz OneRoll-4eac628e2a9eadb08e2c9e673a6f41aea7a58205.zip | |
Merge branch 'master' of github.com:Rolisteam/DiceParser
Diffstat (limited to 'node/keepdiceexecnode.cpp')
| -rw-r--r-- | node/keepdiceexecnode.cpp | 14 |
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()); } |