- Fix issue 42
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-10-25 08:55:56 +00:00
parent cc0b67fb17
commit 24ea5b7b6a
4 changed files with 51 additions and 8 deletions

View File

@@ -25,6 +25,7 @@ generic/rampage2.txt
generic/regenerate.txt
generic/sacrifice.txt
generic/summoning_sickness.txt
generic/tokens.txt
generic/wither.txt
########################
#Specific Cards

View File

@@ -0,0 +1,39 @@
#Bug:Segfault in GuiPlay.cpp
[INIT]
SECONDMAIN
[PLAYER1]
inplay:1138
manapool:{5}
[PLAYER2]
inplay:hypnotic specter
[DO]
1138
eot
eot
next
#upkeep
next
#draw
next
#main
next
#combat begins
next
#attackers
-1138
next
#blockers
hypnotic specter
next
#damage
next
#end combat
eot
next
[ASSERT]
UPKEEP
[PLAYER1]
inplay:the hive
[PLAYER2]
inplay:hypnotic specter
[END]

View File

@@ -104,7 +104,14 @@ void GameObserver::nextGamePhase(){
if (currentGamePhase == Constants::MTG_PHASE_BEFORE_BEGIN){
cleanupPhase();
currentPlayer->canPutLandsIntoPlay = 1;
mLayers->actionLayer()->cleanGarbage(); //clean abilities history for this turn;
mLayers->stackLayer()->garbageCollect(); //clean stack history for this turn;
mLayers->actionLayer()->Update(0);
for (int i=0; i < 2; i++){
delete (players[i]->game->garbage);
players[i]->game->garbage = NEW MTGGameZone();
players[i]->game->garbage->setOwner(players[i]);
}
combatStep = BLOCKERS;
return nextGamePhase();
}
@@ -117,14 +124,7 @@ void GameObserver::nextGamePhase(){
//Auto Hand cleaning, in case the player didn't do it himself
while(currentPlayer->game->hand->nb_cards > 7)
currentPlayer->game->putInGraveyard(currentPlayer->game->hand->cards[0]);
mLayers->actionLayer()->cleanGarbage(); //clean abilities history for this turn;
mLayers->stackLayer()->garbageCollect(); //clean stack history for this turn;
mLayers->actionLayer()->Update(0);
for (int i=0; i < 2; i++){
delete (players[i]->game->garbage);
players[i]->game->garbage = NEW MTGGameZone();
players[i]->game->garbage->setOwner(players[i]);
}
return nextGamePhase();
}

View File

@@ -454,7 +454,10 @@ int TestSuite::phaseStrToInt(string s){
if (s.compare("secondmain") == 0)return Constants::MTG_PHASE_SECONDMAIN;
if (s.compare("endofturn") == 0)return Constants::MTG_PHASE_ENDOFTURN;
if (s.compare("cleanup") == 0)return Constants::MTG_PHASE_CLEANUP;
return -1;
OutputDebugString("TESTSUITEAI: Unknown Phase name:");
OutputDebugString(s.c_str());
OutputDebugString("\n");
return Constants::MTG_PHASE_FIRSTMAIN;
}
void TestSuiteActions::cleanup(){