Replaced unnecessary custom shuffle methods with std::random_shuffle<>.
This commit is contained in:
@@ -574,14 +574,7 @@ void MTGGameZone::cleanupPhase()
|
||||
|
||||
void MTGGameZone::shuffle()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (nb_cards); i++)
|
||||
{
|
||||
int r = i + (WRand() % (nb_cards - i)); // Random remaining position.
|
||||
MTGCardInstance * temp = cards[i];
|
||||
cards[i] = cards[r];
|
||||
cards[r] = temp;
|
||||
}
|
||||
std::random_shuffle(cards.begin(), cards.end());
|
||||
}
|
||||
|
||||
void MTGGameZone::addCard(MTGCardInstance * card)
|
||||
|
||||
Reference in New Issue
Block a user