From 02dce1af2efda965ce1bb0b1dc6b210b81381a8e Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Fri, 10 Feb 2017 21:00:18 +0800 Subject: [PATCH] crash fix transform getaicustomcode to lower --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 4 ++-- projects/mtg/src/MTGAbility.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 6f2ab59c3..ade9d98f5 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -56567,7 +56567,7 @@ type=Enchantment [/card] [card] name=Idyllic Tutor -aicode=moveTo(myhand) notatarget(enchantment|myLibrary) +aicode=activate moveTo(myhand) notatarget(enchantment|myLibrary) auto=Reveal:type:*:mylibrary revealzone(mylibrary) optionone name(choose card) target(<1>enchantment|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(myhand)])) optiononeend optiontwo name(shuffle) bottomoflibrary target(<1>*|reveal) and!( all(*|reveal) bottomoflibrary and!(shuffle)! )! optiontwoend revealend text=Search your library for an enchantment card, reveal it, and put it into your hand. Then shuffle your library. mana={2}{W} @@ -65477,7 +65477,7 @@ toughness=2 [card] name=Lavinia of the Tenth abilities=protection from red -auto=name(detain) transforms((,newability[lord(detained) cantattack],newability[lord(detained) cantblock],newability[lord(detained) noactivatedability],newability[lord(*[manacost<=4]|opponentBattlefield) becomes(detained)])) uynt +auto=name(detain) transforms((,newability[lord(detained) cantattack],newability[lord(detained) cantblock],newability[lord(detained) noactivatedability],newability[lord(*[-land;manacost<=4]|opponentBattlefield) becomes(detained)])) uynt text=Protection from red. -- When Lavinia of the Tenth enters the battlefield, detain each nonland permanent your opponents control with converted mana cost 4 or less. mana={3}{W}{U} type=Legendary Creature diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index f33649b20..fc6832afa 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -3686,7 +3686,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG a->named = newName; if(card->getAICustomCode().size() && card->controller()->isAI()) { - MTGAbility * a3 = parseMagicLine(card->getAICustomCode(), id, spell, card); + string abi = card->getAICustomCode(); + std::transform(abi.begin(), abi.end(), abi.begin(), ::tolower);//fix crash + MTGAbility * a3 = parseMagicLine(abi, id, spell, card); a3->oneShot = 1; a3->canBeInterrupted = false; return a3;