- fixed divergent growth (issue 243). Unfortunately the underlying issue is quite complex, and Wagic doesn't handle it very well. Basically, all "until end of turn" effects run the risk of being partially deleted before the end of the turn, leading to segfaults or memory leaks. This is because some abilities' "clone" method doesn't actually clone them entirely... The fix for divergent growth is a hack that works only for lords+mana producer combination, but I need a more "generic fix" in the long run...
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-12-13 05:59:17 +00:00
parent 7cc072bf77
commit 999256e6ab
5 changed files with 57 additions and 3 deletions
+4 -1
View File
@@ -2247,7 +2247,6 @@ AManaProducer::AManaProducer(int id, MTGCardInstance * card, Targetable * t, Man
AManaProducer::~AManaProducer(){
if (isClone) return;
LOG("==Destroying ManaProducer Object");
SAFE_DELETE(cost);
SAFE_DELETE(output);
@@ -2256,6 +2255,10 @@ AManaProducer::AManaProducer(int id, MTGCardInstance * card, Targetable * t, Man
AManaProducer * AManaProducer::clone() const{
AManaProducer * a = NEW AManaProducer(*this);
a->cost = NEW ManaCost();
a->output = NEW ManaCost();
a->cost->copy(cost);
a->output->copy(output);
a->isClone = 1;
return a;
}