Make random a bit less random, but already sung songs shouldn't be suggested frequently.
This commit is contained in:
1 parent
2d4cedbf8a
commit
524d0bee75
4 files changed
+24
-2
No files matched your search
@@ -513,12 +513,18 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
return false;
|
||||
}
|
||||
|
||||
//Calc avarage sing-count
|
||||
int totalCounts = 0;
|
||||
foreach (CSong song in visibleSongs)
|
||||
totalCounts += song.NumPlayedSession;
|
||||
int averageCount = totalCounts / visibleSongs.Count;
|
||||
|
||||
// ReSharper disable LoopCanBeConvertedToQuery
|
||||
foreach (CSong song in visibleSongs)
|
||||
{
|
||||
foreach (EGameMode mode in song.AvailableGameModes)
|
||||
{
|
||||
if (mode == EGameMode.TR_GAMEMODE_MEDLEY)
|
||||
if (mode == EGameMode.TR_GAMEMODE_MEDLEY && song.NumPlayedSession <= averageCount)
|
||||
ids.Add(song.ID);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user