fixed a bug in targetchoosing where a player would get stuck in a targetchooser under certain situations as follows:

opponent play an ability, player interupts and clicks a card with TargetChooser which has no valid targets; player then tries to cancel targetchooser, instead the stack is displayed again, player is then locked in a TargetChooser unable to click other cards.

originally i was going to do it in the reactToClick however, after thinking about it, it made no sense to me that a targetchooser would be set and a cardwaitingfortargets would be set if you know ahead of time that no valid targets existed.

now when clicking cards which have TargetChoosers and no valid targets, no tc is set, and no cardiswaitingfortargets; instead return 0.
This commit is contained in:
omegablast2002@yahoo.com
2011-09-18 10:34:40 +00:00
parent 2b8d174bfa
commit c0ab80a1bc
2 changed files with 11 additions and 4 deletions

View File

@@ -1098,11 +1098,18 @@ int GameObserver::targetListIsSet(MTGCardInstance * card)
{
TargetChooserFactory tcf;
targetChooser = tcf.createTargetChooser(card);
cardWaitingForTargets = card;
if (targetChooser == NULL)
{
return 1;
}
}
return (targetChooser->targetListSet());
if(targetChooser && targetChooser->validTargetsExist())
{
cardWaitingForTargets = card;
return (targetChooser->targetListSet());
}
else
targetChooser = NULL;
return 0;
}