Commit be77f2fe authored by Thomas Branch's avatar Thomas Branch Committed by Albert Astals Cid

Fix compile error on Windows

error: call of overloaded 'KRandomSequence(time_t)' is ambiguous

Differential Revision: https://phabricator.kde.org/D24420
parent 7e8c2251
......@@ -62,6 +62,8 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <chrono>
#include "kgoldrunner_debug.h"
// TODO - Can we change over to KScoreDialog?
......@@ -115,7 +117,9 @@ KGrGame::KGrGame (KGrView * theView,
connect(dyingTimer, &QTimer::timeout, this, &KGrGame::finalBreath);
// Initialise random number generator.
randomGen = new KRandomSequence (std::time(nullptr));
const auto tse = std::chrono::system_clock::now().time_since_epoch();
const long int seed = std::chrono::duration_cast<std::chrono::seconds>(tse).count();
randomGen = new KRandomSequence (seed);
//qCDebug(KGOLDRUNNER_LOG) << "RANDOM NUMBER GENERATOR INITIALISED";
scene->setReplayMessage (i18n("Click anywhere to begin live play"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment