-Fix for issue 583 (fireball crash)

-- converted an array into a vector to avoid weird edge cases
-- fixed bugs with array "backupTargets"
This commit is contained in:
wagic.the.homebrew
2011-05-26 12:27:44 +00:00
parent ffda1d0548
commit a84eb8dc22
10 changed files with 96 additions and 72 deletions

View File

@@ -1,8 +1,6 @@
#ifndef _TARGETSLIST_H_
#define _TARGETSLIST_H_
#define MAX_TARGETS 20
class Targetable;
class MTGCardInstance;
class Player;
@@ -11,13 +9,15 @@ class Spell;
class Interruptible;
class Damage;
#include <vector>
using std::vector;
class TargetsList
{
public:
int cursor;
TargetsList();
TargetsList(Targetable * _targets[], int nbtargets);
Targetable* targets[MAX_TARGETS];
vector<Targetable*> targets;
int alreadyHasTarget(Targetable * target);
int removeTarget(Targetable * _card);
int toggleTarget(Targetable * _card);
@@ -31,7 +31,7 @@ public:
Targetable * getNextTarget(Targetable * previous = 0, int type = -1);
void initTargets()
{
cursor = 0;
targets.clear();
}
;
};