aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceparser.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2020-07-01 00:00:27 +0200
committerRenaud Guezennec <renaud@rolisteam.org>2020-08-01 19:35:02 +0000
commit591fbbd71b10a5f086fab622f7dfe43f3a8adcb6 (patch)
tree3ccfff5317eaa75a03cb5f1fa8128a16217dae96 /diceparser.cpp
parenteb5e5c0b9c3ea6b8fe384e601cb93b0114cf7842 (diff)
downloadOneRoll-591fbbd71b10a5f086fab622f7dfe43f3a8adcb6.tar.gz
OneRoll-591fbbd71b10a5f086fab622f7dfe43f3a8adcb6.zip
Fix some behaviours about
Diffstat (limited to 'diceparser.cpp')
-rw-r--r--diceparser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/diceparser.cpp b/diceparser.cpp
index 5c0590c..7adf610 100644
--- a/diceparser.cpp
+++ b/diceparser.cpp
@@ -368,11 +368,12 @@ bool DiceParser::hasResultOfType(Dice::RESULT_TYPE type, ExecutionNode* node, QV
bool scalarDone= false;
ExecutionNode* next= ParsingToolBox::getLeafNode(node);
Result* result= next->getResult();
+ int i= 0;
while((result != nullptr) && (!scalarDone))
{
bool lastResult= false;
if(notthelast)
- lastResult= (nullptr == result->getPrevious());
+ lastResult= (nullptr == result->getPrevious() && i != 0);
if(result->hasResultOfType(type) && !lastResult)
{
@@ -380,6 +381,7 @@ bool DiceParser::hasResultOfType(Dice::RESULT_TYPE type, ExecutionNode* node, QV
value= result->getResult(type);
}
result= result->getPrevious();
+ ++i;
}
return scalarDone;
}