Commit c7c5e654 authored by Bkg2k's avatar Bkg2k

chore(demo): improve randomness

parent b6aab442
......@@ -93,7 +93,7 @@ bool DemoMode::getRandomSystem(int& outputSystemIndex, int& outputDuration)
outputSystemIndex = mSystemRandomizer(mRandomGenerator);
outputDuration = mDurations[outputSystemIndex];
if (!isInHistory(outputSystemIndex, mSystemHistory, (int)mDemoSystems.size()) || (mDemoSystems.size() == 1))
if (!isInHistory(outputSystemIndex, mSystemHistory, (int)mDemoSystems.size() / 2) || (mDemoSystems.size() == 1))
{
// Save history
insertIntoHistory(outputSystemIndex, mSystemHistory);
......@@ -132,7 +132,7 @@ bool DemoMode::getRandomGame(FileData*& outputGame, int& outputDuration)
gamePosition = (mGameRandomizer(mRandomGenerator) + i + mSeed) % (int)gameList.size();
outputGame = gameList[gamePosition];
if (!isInHistory(gamePosition, mGameHistories[systemIndex], (int)gameList.size()) || (gameList.size() == 1))
if (!isInHistory(gamePosition, mGameHistories[systemIndex], (int)gameList.size() / 2) || (gameList.size() == 1))
{
// Save history
insertIntoHistory(gamePosition, mGameHistories[systemIndex]);
......
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