aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/dicerollernode.cpp2
-rw-r--r--node/keepdiceexecnode.cpp4
-rw-r--r--node/listsetrollnode.cpp2
-rw-r--r--node/splitnode.cpp3
-rw-r--r--node/variablenode.cpp7
-rw-r--r--node/variablenode.h2
6 files changed, 7 insertions, 13 deletions
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp
index 1f501e5..70fd245 100644
--- a/node/dicerollernode.cpp
+++ b/node/dicerollernode.cpp
@@ -29,7 +29,7 @@ void DiceRollerNode::run(ExecutionNode* previous)
{
m_errors.insert(NO_DICE_TO_ROLL,QObject::tr("No dice to roll"));
}
- auto possibleValue = (m_max-m_min)+1;
+ auto possibleValue = static_cast<quint64>(abs((m_max-m_min)+1));
//qDebug() << possibleValue;
if( possibleValue < m_diceCount && m_unique)
{
diff --git a/node/keepdiceexecnode.cpp b/node/keepdiceexecnode.cpp
index a93cc11..547e343 100644
--- a/node/keepdiceexecnode.cpp
+++ b/node/keepdiceexecnode.cpp
@@ -49,7 +49,7 @@ void KeepDiceExecNode::run(ExecutionNode* previous)
QList<Die*> diceList3= diceList.mid(0,m_numberOfDice);
QList<Die*> diceList2;
- foreach(Die* die,diceList3)
+ for(Die* die : diceList3)
{
Die* tmpdie = new Die();
*tmpdie=*die;
@@ -59,7 +59,7 @@ void KeepDiceExecNode::run(ExecutionNode* previous)
- if(m_numberOfDice > diceList.size())
+ if(m_numberOfDice > static_cast<quint64>(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()));
}
diff --git a/node/listsetrollnode.cpp b/node/listsetrollnode.cpp
index d7d4566..e6ffd00 100644
--- a/node/listsetrollnode.cpp
+++ b/node/listsetrollnode.cpp
@@ -65,7 +65,7 @@ void ListSetRollNode::run(ExecutionNode* previous)
if(nullptr!=result)
{
quint64 diceCount = result->getResult(Result::SCALAR).toReal();
- if(diceCount > m_values.size() && m_unique)
+ if(diceCount > static_cast<quint64>(m_values.size()) && m_unique)
{
m_errors.insert(TOO_MANY_DICE,QObject::tr("More unique values asked than possible values (L operator)"));
}
diff --git a/node/splitnode.cpp b/node/splitnode.cpp
index ed32fdd..d44bad5 100644
--- a/node/splitnode.cpp
+++ b/node/splitnode.cpp
@@ -47,7 +47,8 @@ void SplitNode::run(ExecutionNode* previous)
{
Die* tmpdie = new Die();
tmpdie->insertRollValue(value);
- tmpdie->setFaces(oldDie->getFaces());
+ tmpdie->setBase(oldDie->getBase());
+ tmpdie->setMaxValue(oldDie->getMaxValue());
tmpdie->setValue(value);
tmpdie->setOp(oldDie->getOp());
m_diceResult->insertResult(tmpdie);
diff --git a/node/variablenode.cpp b/node/variablenode.cpp
index f202246..9963af9 100644
--- a/node/variablenode.cpp
+++ b/node/variablenode.cpp
@@ -8,13 +8,6 @@ VariableNode::VariableNode()
void VariableNode::run(ExecutionNode *previous)
{
m_previousNode = previous;
-
- if(m_index<0)
- {
- m_errors.insert(INVALID_INDEX,QObject::tr("Invalid index must be greater than 0 :%1").arg(m_index));
- return;
- }
-
if(m_data->size()>m_index)
{
auto value= (*m_data)[m_index];
diff --git a/node/variablenode.h b/node/variablenode.h
index 6e9cc78..1df9acd 100644
--- a/node/variablenode.h
+++ b/node/variablenode.h
@@ -26,7 +26,7 @@ public:
void setData(std::vector<ExecutionNode *>* data);
private:
- qint64 m_index;
+ quint64 m_index;
std::vector<ExecutionNode*>* m_data;
};