From befb3f246b8a57abcc60086dc9ad08a1964e74d0 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Tue, 3 Nov 2009 07:40:14 +0000 Subject: [PATCH] Erwan - fix issue 149 --- projects/mtg/bin/Res/test/bugs/kicker_crash_i149.txt | 3 +-- projects/mtg/src/MTGAbility.cpp | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/mtg/bin/Res/test/bugs/kicker_crash_i149.txt b/projects/mtg/bin/Res/test/bugs/kicker_crash_i149.txt index 77bcae264..f53901047 100644 --- a/projects/mtg/bin/Res/test/bugs/kicker_crash_i149.txt +++ b/projects/mtg/bin/Res/test/bugs/kicker_crash_i149.txt @@ -9,9 +9,8 @@ hand:kavu aggressor [DO] ai [ASSERT] -combatblockers +UNTAP [PLAYER1] inplay:mountain,mountain,mountain,kavu aggressor -hand: [PLAYER2] [END] diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index ba9d82fc9..86edb9637 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -164,6 +164,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell //Parses a string and returns the corresponding MTGAbility object // Returns NULL if parsing failed +//Beware, Spell CAN be null when the function is called by the AI trying to analyze the effects of a given card MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated, int forceUEOT){ size_t found; @@ -251,7 +252,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG //kicker cost found = s.find("kicker "); if (found == 0){ - if (spell->kickerWasPaid()){ + if (spell && spell->kickerWasPaid()){ string s1 = s.substr(found+7); return parseMagicLine(s1,id,spell, card); }