Fixes for Boosters in the Shop. Fixes issue 644 and issue 621

This commit is contained in:
wagic.the.homebrew
2011-05-05 05:51:50 +00:00
parent 9902b1c74b
commit 4c572a1ffa
2 changed files with 20 additions and 6 deletions

View File

@@ -46,9 +46,11 @@ int MTGPackSlot::add(WSrcCards * ocean, MTGDeck *to, int carryover)
myPool = MTGPack::getPool(pool);
if (!myPool)
myPool = ocean;
for (int i = 0; i < amt; i++)
{
size_t pos = rand() % entries.size();
std::random_shuffle(entries.begin(), entries.end());
size_t pos = 0;
while (pos < entries.size() && entries[pos]->addCard(myPool, to))
pos++;
if (pos == entries.size())
@@ -378,6 +380,10 @@ MTGPack * MTGPacks::getDefault()
defaultBooster.slotss.push_back(ps);
defaultBooster.bValid = true;
defaultBooster.unlockStatus = 1;
for (size_t i = 0; i < defaultBooster.slotss.size(); ++ i)
{
defaultBooster.slotss[i]->addEntry(NEW MTGPackEntryRandom("rarity:special;"));
}
}
}
return &defaultBooster;