Erwan
- Fixing issue 234 (segfault risk with "becomes")
This commit is contained in:
@@ -759,7 +759,7 @@ text=Target noncreature artifact becomes an artifact creature with power and tou
|
|||||||
id=19573
|
id=19573
|
||||||
name=Karn's Touch
|
name=Karn's Touch
|
||||||
target=artifact[-creature]
|
target=artifact[-creature]
|
||||||
auto=becomes(Creature,manacost/manacost)
|
auto=becomes(Creature,manacost/manacost) ueot
|
||||||
rarity=R
|
rarity=R
|
||||||
mana={U}{U}
|
mana={U}{U}
|
||||||
type=Instant
|
type=Instant
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ immaculate_magistrate.txt
|
|||||||
instill_energy_i166.txt
|
instill_energy_i166.txt
|
||||||
jodahs_avenger.txt
|
jodahs_avenger.txt
|
||||||
jump.txt
|
jump.txt
|
||||||
|
karns_touch_i233.txt
|
||||||
keldon_warlord.txt
|
keldon_warlord.txt
|
||||||
keldon_warlord2.txt
|
keldon_warlord2.txt
|
||||||
kird_ape.txt
|
kird_ape.txt
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ Jayemdae Tome
|
|||||||
[ASSERT]
|
[ASSERT]
|
||||||
firstmain
|
firstmain
|
||||||
[PLAYER1]
|
[PLAYER1]
|
||||||
graveyard:Karn's Touch,Swords to Plowshares,Jayemdae Tome
|
graveyard:Karn's Touch,Swords to Plowshares
|
||||||
life:24
|
life:24
|
||||||
[PLAYER2]
|
[PLAYER2]
|
||||||
[END]
|
[END]
|
||||||
@@ -2292,17 +2292,25 @@ public:
|
|||||||
class ABecomesUEOT: public InstantAbility{
|
class ABecomesUEOT: public InstantAbility{
|
||||||
public:
|
public:
|
||||||
ABecomes * ability;
|
ABecomes * ability;
|
||||||
|
vector<ABecomes *> clones;
|
||||||
ABecomesUEOT(int id, MTGCardInstance * source, MTGCardInstance * target, string types, WParsedPT * wpt, string abilities):InstantAbility(id,source,target){
|
ABecomesUEOT(int id, MTGCardInstance * source, MTGCardInstance * target, string types, WParsedPT * wpt, string abilities):InstantAbility(id,source,target){
|
||||||
ability = NEW ABecomes(id,source,target,types,wpt,abilities);
|
ability = NEW ABecomes(id,source,target,types,wpt,abilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
int resolve(){
|
int resolve(){
|
||||||
ability->addToGame();
|
ABecomes * a = ability->clone();
|
||||||
|
a->target = this->target;
|
||||||
|
a->forceDestroy = -1; //Prevent the effect from getting destroyed because its source is not inplay
|
||||||
|
a->addToGame();
|
||||||
|
clones.push_back(a);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int destroy(){
|
int destroy(){
|
||||||
ability->destroy();
|
for (size_t i = 0; i < clones.size(); ++i){
|
||||||
|
clones[i]->forceDestroy = 0;
|
||||||
|
}
|
||||||
|
clones.clear();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user