aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node/dicerollernode.cpp
diff options
context:
space:
mode:
authorrenaud guezennec <renaud@rolisteam.org>2019-07-29 20:35:52 +0000
committerrenaud guezennec <renaud@rolisteam.org>2019-07-29 20:35:52 +0000
commit1a902d383eef1e042d4462cd07b9384fcdf4d118 (patch)
tree766b8ab720fa5da11730d2fc2388f51b9d14de49 /node/dicerollernode.cpp
parentf5906125576a8323a731c9456ce3dfc53b67ef59 (diff)
parent0d4b68221bda594cc695d216dfa21306ddb69c85 (diff)
downloadOneRoll-1a902d383eef1e042d4462cd07b9384fcdf4d118.tar.gz
OneRoll-1a902d383eef1e042d4462cd07b9384fcdf4d118.zip
Merge branch 'liberation' into 'master'
Add fuzzer on the DiceParser See merge request kde/rolisteam-diceparser!2
Diffstat (limited to 'node/dicerollernode.cpp')
-rw-r--r--node/dicerollernode.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/node/dicerollernode.cpp b/node/dicerollernode.cpp
index f57d3e3..f87908f 100644
--- a/node/dicerollernode.cpp
+++ b/node/dicerollernode.cpp
@@ -19,10 +19,10 @@ void DiceRollerNode::run(ExecutionNode* previous)
Result* result= previous->getResult();
if(nullptr != result)
{
- auto num= result->getResult(Result::SCALAR).toReal();
+ auto num= result->getResult(Dice::RESULT_TYPE::SCALAR).toReal();
if(num <= 0)
{
- m_errors.insert(NO_DICE_TO_ROLL, QObject::tr("No dice to roll"));
+ m_errors.insert(Dice::ERROR_CODE::NO_DICE_TO_ROLL, QObject::tr("No dice to roll"));
}
m_diceCount= num > 0 ? static_cast<quint64>(num) : 0;
m_result->setPrevious(result);
@@ -30,7 +30,7 @@ void DiceRollerNode::run(ExecutionNode* previous)
auto possibleValue= static_cast<quint64>(std::abs((m_max - m_min) + 1));
if(possibleValue < m_diceCount && m_unique)
{
- m_errors.insert(TOO_MANY_DICE,
+ m_errors.insert(Dice::ERROR_CODE::TOO_MANY_DICE,
QObject::tr("More unique values asked than possible values (D operator)"));
return;
}
@@ -62,7 +62,7 @@ void DiceRollerNode::run(ExecutionNode* previous)
quint64 DiceRollerNode::getFaces() const
{
- return std::abs(m_max - m_min) + 1;
+ return static_cast<quint64>(std::abs(m_max - m_min) + 1);
}
std::pair<qint64, qint64> DiceRollerNode::getRange() const