Partymodes: Fix "Select random" button selecting invalid profiles
which would happen if the number of visible profiles matched the number of used profiles or if there were more slots than usable profiles
This commit is contained in:
1 parent
3f5cb818a2
commit
1a85f56fb4
2 files changed
+5
-16
No files matched your search
@@ -774,7 +774,8 @@ namespace VocaluxeLib.Menu
|
||||
for (int p = 0; p < _NumPlayerTeams[t]; p++)
|
||||
{
|
||||
int profileID = _NameSelections[_NameSelection].GetRandomUnusedProfile();
|
||||
_AddPlayer(t, profileID);
|
||||
if(profileID >= 0) //only add valid profiles
|
||||
_AddPlayer(t, profileID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user