- fix for issue 756 (cycling not working for first 7 drawn cards)

- minor cleanup of MTGGameZones.cpp
This commit is contained in:
wagic.the.homebrew
2011-11-12 10:14:27 +00:00
parent a94e0a11cf
commit d654b050df
5 changed files with 8 additions and 33 deletions
+6 -23
View File
@@ -213,31 +213,14 @@ void MTGPlayerCards::drawFromLibrary()
{
if (!library->nb_cards)
{
int cantlosers = 0;
MTGGameZone * z = library->owner->game->inPlay;
int nbcards = z->nb_cards;
for (int i = 0; i < nbcards; ++i)
if (inPlay->hasAbility(Constants::CANTLOSE)
|| inPlay->hasAbility(Constants::CANTMILLLOSE)
|| owner->opponent()->game->inPlay->hasAbility(Constants::CANTWIN))
{
MTGCardInstance * c = z->cards[i];
if (c->has(Constants::CANTLOSE) || c->has(Constants::CANTMILLLOSE))
{
cantlosers++;
}
}
MTGGameZone * k = library->owner->opponent()->game->inPlay;
int onbcards = k->nb_cards;
for (int m = 0; m < onbcards; ++m)
{
MTGCardInstance * e = k->cards[m];
if (e->has(Constants::CANTWIN))
{
cantlosers++;
}
}
if (cantlosers < 1)
{
library->owner->getObserver()->gameOver = library->owner;
return;
}
library->owner->getObserver()->gameOver = library->owner;
return;
}
MTGCardInstance * toMove = library->cards[library->nb_cards - 1];