fixed a memleak introduced in r3639..
i also changed the logic behind wololo "ueot " instant ability creator...instead of sending it directly to genericinstantability i created a new class called AGenericInstantWrapper...which handles the adding, cloning, removel ect, exactly how we have always handled "instant abilities"...this should correct any further "odd edge case" issues with the new "ueot " code... later i will varify if it works with every single ability we current build with a wrapper class...and see if i cant remove them all and convert "ueot " into the NEW until end of turn handling method....lets cross our fingers as it would remove ALOT of extra code if successful....
This commit is contained in:
@@ -825,6 +825,20 @@ public:
|
||||
return a;
|
||||
}
|
||||
};
|
||||
|
||||
//make instant ability out of anything
|
||||
class AGenericInstantWrapper: public InstantAbility
|
||||
{
|
||||
public:
|
||||
MTGAbility * ability;
|
||||
|
||||
AGenericInstantWrapper(int id, MTGCardInstance * source, Damageable * target,MTGAbility * wrapThis);
|
||||
int resolve();
|
||||
const char * getMenuText();
|
||||
AGenericInstantWrapper * clone() const;
|
||||
~AGenericInstantWrapper();
|
||||
};
|
||||
|
||||
//counters
|
||||
class AACounter: public ActivatedAbility
|
||||
{
|
||||
@@ -1766,7 +1780,6 @@ public:
|
||||
GenericInstantAbility * clone() const
|
||||
{
|
||||
GenericInstantAbility * a = NEW GenericInstantAbility(*this);
|
||||
a->ability = ability->clone();
|
||||
a->isClone = 1;
|
||||
return a;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user