aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/die.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2019-07-28 01:07:11 +0200
committerRenaud G <renaud@rolisteam.org>2019-07-28 01:07:11 +0200
commitf1a89a3ca758c8af549e62ad4258504cb2bc2c7c (patch)
tree7d554a53c556f2ec7aecb4192fb275923e006e00 /die.cpp
parent0fd45ce5b17fa90929800766c0a7b5631541ae2c (diff)
downloadOneRoll-f1a89a3ca758c8af549e62ad4258504cb2bc2c7c.tar.gz
OneRoll-f1a89a3ca758c8af549e62ad4258504cb2bc2c7c.zip
Fix dice copy constructor and set default value
Diffstat (limited to 'die.cpp')
-rw-r--r--die.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/die.cpp b/die.cpp
index 2d2ff91..531853c 100644
--- a/die.cpp
+++ b/die.cpp
@@ -35,7 +35,7 @@ Die::Die()
, m_op(Die::PLUS) //,m_mt(m_randomDevice)
{
auto seed= std::chrono::high_resolution_clock::now().time_since_epoch().count();
- m_rng= std::mt19937(quintptr(this) + seed);
+ m_rng= std::mt19937(quintptr(this) + static_cast<unsigned long long>(seed));
}
Die::Die(const Die& die)
{
@@ -49,6 +49,8 @@ Die::Die(const Die& die)
m_base= die.m_base;
m_color= die.getColor();
m_op= die.getOp();
+ auto seed= std::chrono::high_resolution_clock::now().time_since_epoch().count();
+ m_rng= std::mt19937(quintptr(this) + static_cast<unsigned long long>(seed));
}
void Die::setValue(qint64 r)