aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/sortresult.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2014-11-09 12:06:54 +0100
committerRenaud G <renaud@rolisteam.org>2014-11-09 12:06:54 +0100
commit8e9cad0753457ce3d245a626fb4ad693e5701703 (patch)
treeacbb9bcc426f7fc124745efd75bdd03c91c734e5 /node/sortresult.cpp
parentf02ce9666d5801b57e316bd93cd1ccba4fee5cd0 (diff)
downloadOneRoll-8e9cad0753457ce3d245a626fb4ad693e5701703.tar.gz
OneRoll-8e9cad0753457ce3d245a626fb4ad693e5701703.zip
Add error management. Protect sort node after scalar result node.
Diffstat (limited to 'node/sortresult.cpp')
-rw-r--r--node/sortresult.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/node/sortresult.cpp b/node/sortresult.cpp
index 8a0e58d..c80ebec 100644
--- a/node/sortresult.cpp
+++ b/node/sortresult.cpp
@@ -17,7 +17,7 @@ void SortResultNode::run(ExecutionNode* node)
{
return;
}
- DiceResult* previousDiceResult = static_cast<DiceResult*>(node->getResult());
+ DiceResult* previousDiceResult = dynamic_cast<DiceResult*>(node->getResult());
m_diceResult->setPrevious(previousDiceResult);
if(NULL!=previousDiceResult)
{
@@ -61,12 +61,7 @@ void SortResultNode::run(ExecutionNode* node)
}
}
- //qDebug() << tmp1->getValue() << j << found;
- //if(found)
- diceList2.insert(j,tmp1);
- /*else
- diceList2.append(tmp1);*/
-
+ diceList2.insert(j,tmp1);
}
if(!m_ascending)
@@ -86,6 +81,10 @@ void SortResultNode::run(ExecutionNode* node)
m_nextNode->run(this);
}
}
+ else
+ {
+ m_errors.append(DIE_RESULT_EXPECTED);
+ }
}
void SortResultNode::setSortAscending(bool asc)