diff options
Diffstat (limited to 'node/keepdiceexecnode.cpp')
| -rw-r--r-- | node/keepdiceexecnode.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp index ab961af..d36abec 100644 --- a/node/keepdiceexecnode.cpp +++ b/node/keepdiceexecnode.cpp @@ -29,7 +29,10 @@ KeepDiceExecNode::KeepDiceExecNode() { m_result = m_diceResult; } +KeepDiceExecNode::~KeepDiceExecNode() +{ +} void KeepDiceExecNode::run(ExecutionNode* previous) { m_previousNode = previous; @@ -42,7 +45,20 @@ void KeepDiceExecNode::run(ExecutionNode* previous) if(NULL!=previousDiceResult) { QList<Die*> diceList=previousDiceResult->getResultList(); - QList<Die*> diceList2 = diceList.mid(0,m_numberOfDice); + + QList<Die*> diceList3= diceList.mid(0,m_numberOfDice); + QList<Die*> diceList2; + + foreach(Die* die,diceList3) + { + Die* tmpdie = new Die(); + *tmpdie=*die; + diceList2.append(tmpdie); + die->displayed(); + } + + + if(m_numberOfDice > diceList.size()) { m_errors.insert(TOO_MANY_DICE,QObject::tr(" You ask to keep %1 dice but the result only has %2").arg(m_numberOfDice).arg(diceList.size())); |