diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index d5537c040..9e712eb60 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -223,6 +223,7 @@ sword_to_plowshares.txt telekinetic_sliver.txt terror.txt terror2.txt +threaten.txt titanic_ultimatum.txt torture.txt tranquil_domain.txt diff --git a/projects/mtg/bin/Res/test/threaten.txt b/projects/mtg/bin/Res/test/threaten.txt new file mode 100644 index 000000000..2646c9568 --- /dev/null +++ b/projects/mtg/bin/Res/test/threaten.txt @@ -0,0 +1,21 @@ +#Bug: Threaten on own creature crashes the game +# http://code.google.com/p/wagic/issues/detail?id=105 +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:grizzly bears +hand:threaten +manapool:{2}{R} +[PLAYER2] +[DO] +threaten +grizzly bears +eot +eot +[ASSERT] +UNTAP +[PLAYER1] +inplay:grizzly bears +graveyard:threaten +[PLAYER2] +[END] \ No newline at end of file diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index a61775f66..27b20c544 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -294,7 +294,7 @@ int MTGCardInstance::hasSummoningSickness(){ MTGCardInstance * MTGCardInstance::changeController(Player * newController){ Player * originalOwner = controller(); - if (originalOwner == newController) return 0; + if (originalOwner == newController) return this; MTGCardInstance * copy = originalOwner->game->putInZone(this, originalOwner->game->inPlay, newController->game->inPlay); copy->summoningSickness = 1; return copy;