aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceparser.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2016-01-30 16:53:38 +0100
committerRenaud G <renaud@rolisteam.org>2016-01-30 16:53:38 +0100
commitd0382d1e01646c6bc634ed08fe1c9aa009470432 (patch)
tree73cd39cc0b7a4874169ba8ce08481a58d56302a6 /diceparser.cpp
parent5a134dfc687551f0df25b52a37ad2e4467cd23be (diff)
downloadOneRoll-d0382d1e01646c6bc634ed08fe1c9aa009470432.tar.gz
OneRoll-d0382d1e01646c6bc634ed08fe1c9aa009470432.zip
Cppcheck warning for ifnode.
Diffstat (limited to 'diceparser.cpp')
-rw-r--r--diceparser.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/diceparser.cpp b/diceparser.cpp
index ebd163d..8d96d5a 100644
--- a/diceparser.cpp
+++ b/diceparser.cpp
@@ -977,23 +977,25 @@ bool DiceParser::readIfInstruction(QString& str,ExecutionNode*& trueNode,Executi
{
str=str.remove(0,1);
ExecutionNode* node;
- bool hasExpresion = readExpression(str,node);
- if(str.startsWith('}'))
+ if(readExpression(str,node))
{
- trueNode = node;
- str=str.remove(0,1);
- if(str.startsWith('{'))
+ if(str.startsWith('}'))
{
+ trueNode = node;
str=str.remove(0,1);
- ExecutionNode* node2;
- readExpression(str,node2);
- if(str.startsWith('}'))
+ if(str.startsWith('{'))
{
- falseNode=node2;
- return true;
+ str=str.remove(0,1);
+ ExecutionNode* node2;
+ readExpression(str,node2);
+ if(str.startsWith('}'))
+ {
+ falseNode=node2;
+ return true;
+ }
}
+ return true;
}
- return true;
}
}
return false;