aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--die.cpp4
-rw-r--r--die.h4
2 files changed, 5 insertions, 3 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)
diff --git a/die.h b/die.h
index f544808..eb43521 100644
--- a/die.h
+++ b/die.h
@@ -151,8 +151,8 @@ private:
bool m_hasValue= false;
bool m_displayStatus= false;
bool m_highlighted= true;
- qint64 m_maxValue;
- qint64 m_base;
+ qint64 m_maxValue= 0;
+ qint64 m_base= 0;
QString m_color;
Die::ArithmeticOperator m_op;