aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2019-09-05 00:40:40 +0200
committerRenaud G <renaud@rolisteam.org>2019-09-05 00:40:40 +0200
commit1c875b651df3afafe1df6b8ae412124d67e526a6 (patch)
treee79f03a998c10f9d546b4ece060af68956bacca4 /node
parentb0ec3dfffda7991eee5775dcebb04731ba6a8389 (diff)
downloadOneRoll-1c875b651df3afafe1df6b8ae412124d67e526a6.tar.gz
OneRoll-1c875b651df3afafe1df6b8ae412124d67e526a6.zip
Copy die but prevent them to be displayed twice.
Diffstat (limited to 'node')
-rw-r--r--node/variablenode.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/node/variablenode.cpp b/node/variablenode.cpp
index e45214d..0f5a0b0 100644
--- a/node/variablenode.cpp
+++ b/node/variablenode.cpp
@@ -14,7 +14,16 @@ void VariableNode::run(ExecutionNode* previous)
auto result= value->getResult();
if(result)
{
- m_result= result->getCopy();
+ auto copy= result->getCopy();
+ auto diceResult= dynamic_cast<DiceResult*>(result);
+ if(nullptr != diceResult)
+ {
+ for(auto& die : diceResult->getResultList())
+ {
+ die->setDisplayed(false);
+ }
+ }
+ m_result= copy;
if(nullptr != m_nextNode)
{
m_nextNode->run(this);