- fixed a few memory leaks (but Wagic still crashes on the PSP after a few games :( )
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-04-12 12:39:44 +00:00
parent e9cb57dbb1
commit e7678522ee
11 changed files with 361 additions and 272 deletions

View File

@@ -843,6 +843,10 @@ class AProtectionFrom:public MTGAbility{
return 1;
}
~AProtectionFrom(){
delete(cd);
}
};
//Aura Enchantments that provide controller of target life or damages at a given phase of their turn
@@ -979,7 +983,6 @@ class AConvertLandToCreatures:public ListMaintainerAbility{
//Lords (Merfolk lord...) give power and toughness to OTHER creatures of their type, they can give them special abilities, regeneration
class ALord:public ListMaintainerAbility{
public:
TargetChooser * tc;
int power, toughness;
int ability;
int modifier;
@@ -1035,7 +1038,6 @@ class ALord:public ListMaintainerAbility{
//Foreach (plague rats...)
class AForeach:public ListMaintainerAbility{
public:
TargetChooser * tc;
int power, toughness;
int includeSelf;
AForeach(int _id, MTGCardInstance * card,MTGCardInstance * _target, TargetChooser * _tc, int _includeSelf, int _power = 0 , int _toughness = 0):ListMaintainerAbility(_id,card,_target){
@@ -2780,7 +2782,6 @@ class AMinionofLeshrac: public TargetAbility{
//Generic Kird Ape
class AKirdApe:public ListMaintainerAbility{
public:
TargetChooser * tc;
int power;
int toughness;
int ability;
@@ -2822,9 +2823,6 @@ class AKirdApe:public ListMaintainerAbility{
return 0;
}
~AKirdApe(){
delete tc;
}
};

View File

@@ -95,7 +95,6 @@ class ActivatedAbility:public MTGAbility{
virtual int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
virtual int reactToTargetClick(Targetable * object);
virtual int resolve() = 0;
virtual ~ActivatedAbility();
};
class TargetAbility:public ActivatedAbility{

View File

@@ -38,6 +38,7 @@ class TargetChooser: public TargetsList {
virtual int canTarget(Targetable * _target);
virtual int full(){if (maxtargets != -1 && cursor>=maxtargets) {return 1;} else{return 0;}};
virtual int ready(){return cursor;};
virtual ~TargetChooser(){};
int targetListSet();
@@ -103,6 +104,7 @@ class DescriptorTargetChooser:public TargetZoneChooser{
DescriptorTargetChooser(CardDescriptor * _cd, MTGCardInstance * card = NULL, int _maxtargets = 1);
DescriptorTargetChooser(CardDescriptor * _cd, MTGGameZone ** _zones, int nbzones, MTGCardInstance * card = NULL, int _maxtargets = 1);
virtual int canTarget(Targetable * target);
~DescriptorTargetChooser();
};