-Fix for issue 583 (fireball crash)

-- converted an array into a vector to avoid weird edge cases
-- fixed bugs with array "backupTargets"
This commit is contained in:
wagic.the.homebrew
2011-05-26 12:27:44 +00:00
parent ffda1d0548
commit a84eb8dc22
10 changed files with 96 additions and 72 deletions

View File

@@ -486,7 +486,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
size_t start = attribute.find("share!");
size_t end = attribute.rfind("!");
string CDtype = attribute.substr(start + 6,end - start);
if( card && card->isSpell() && card->backupTargets[0]->typeAsTarget() == TARGET_STACKACTION)
if( card && card->isSpell() && card->backupTargets.size() && card->backupTargets[0]->typeAsTarget() == TARGET_STACKACTION)
{
//spells always store their targets in :targets[]
//however they are all erased as the spell resolves
@@ -785,7 +785,7 @@ int TargetChooser::ForceTargetListReady()
int TargetChooser::targetsReadyCheck()
{
if (cursor <= 0)
if (!targets.size())
{
return TARGET_NOK;
}