diff options
| author | 2019-07-28 01:07:11 +0200 | |
|---|---|---|
| committer | 2019-07-28 01:07:11 +0200 | |
| commit | f1a89a3ca758c8af549e62ad4258504cb2bc2c7c (patch) | |
| tree | 7d554a53c556f2ec7aecb4192fb275923e006e00 /die.cpp | |
| parent | 0fd45ce5b17fa90929800766c0a7b5631541ae2c (diff) | |
| download | OneRoll-f1a89a3ca758c8af549e62ad4258504cb2bc2c7c.tar.gz OneRoll-f1a89a3ca758c8af549e62ad4258504cb2bc2c7c.zip | |
Fix dice copy constructor and set default value
Diffstat (limited to 'die.cpp')
| -rw-r--r-- | die.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) |