diff options
| author | 2018-03-12 12:02:58 +0100 | |
|---|---|---|
| committer | 2018-03-12 12:02:58 +0100 | |
| commit | 618535737008d076ae687602381bb4e9a542fd91 (patch) | |
| tree | cb91cbadd67520c338b3b1c4f90c700df367c4ca | |
| parent | 94f98fb14403d0442fce8fd427bb470e4d17e7b3 (diff) | |
| download | OneRoll-618535737008d076ae687602381bb4e9a542fd91.tar.gz OneRoll-618535737008d076ae687602381bb4e9a542fd91.zip | |
fix stuff on diceparser
| -rw-r--r-- | diceparser.cpp | 5 | ||||
| -rw-r--r-- | node/helpnode.cpp | 34 |
2 files changed, 20 insertions, 19 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index 311b3a4..d73404d 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -549,7 +549,10 @@ void DiceParser::getLastDiceResult(QList<ExportedDiceResult>& diceValuesList,boo } result = result->getPrevious(); } - diceValuesList.append(diceValues); + if(!diceValues.isEmpty()) + { + diceValuesList.append(diceValues); + } } } QString DiceParser::getDiceCommand() const diff --git a/node/helpnode.cpp b/node/helpnode.cpp index bcd7aaf..a6b3c93 100644 --- a/node/helpnode.cpp +++ b/node/helpnode.cpp @@ -26,20 +26,18 @@ HelpNode::HelpNode() } void HelpNode::run(ExecutionNode* previous) { - m_previousNode = previous; + m_previousNode = previous; StringResult* txtResult = dynamic_cast<StringResult*>(m_result); txtResult->setHighLight(false); - if(nullptr != previous) + if((nullptr == previous)&&(txtResult != nullptr)) { - if(previous->getResult() == nullptr) - { - txtResult->setText(QObject::tr("Rolisteam Dice Parser:\nFull documentation at: %1").arg(m_path)); - } - else - { - txtResult->setText(previous->getHelp()); - } + txtResult->setText(QObject::tr("Rolisteam Dice Parser:\nFull documentation at: %1").arg(m_path)); + m_result->setPrevious(nullptr); + } + else if(nullptr != previous) + { + txtResult->setText(previous->getHelp()); m_result->setPrevious(previous->getResult()); } @@ -50,14 +48,14 @@ void HelpNode::run(ExecutionNode* previous) } QString HelpNode::toString(bool wl) const { - if(wl) - { - return QString("%1 [label=\"Rolisteam Dice Parser:\nFull documentation at: %2\"]").arg(m_id).arg(m_path); - } - else - { - return m_id; - } + if(wl) + { + return QString("%1 [label=\"Rolisteam Dice Parser:\nFull documentation at: %2\"]").arg(m_id).arg(m_path); + } + else + { + return m_id; + } } qint64 HelpNode::getPriority() const |