fixed memory leak in double tap gesture

fixed some compiler warnings
removed dead and useless code
This commit is contained in:
techdragon.nguyen@gmail.com
2011-10-08 00:56:07 +00:00
parent 9f09bbeec3
commit fbe2e44814
14 changed files with 53 additions and 51 deletions

View File

@@ -87,7 +87,7 @@ int AIAction::clickMultiAct(vector<Targetable*>& actionTargets)
{
GameObserver * g = owner->getObserver();
TargetChooser * tc = g->getCurrentTargetChooser();
bool sourceIncluded = false;
if(!tc) return 0;
for(size_t f = 0;f < actionTargets.size();f++)
{
@@ -96,7 +96,6 @@ int AIAction::clickMultiAct(vector<Targetable*>& actionTargets)
{
g->cardClick(card);
actionTargets.erase(actionTargets.begin() + f);
sourceIncluded = true;
}
}
std::random_shuffle(actionTargets.begin(), actionTargets.end());
@@ -157,7 +156,6 @@ int AIPlayer::Act(float dt)
int AIPlayer::clickMultiTarget(TargetChooser * tc, vector<Targetable*>& potentialTargets)
{
bool sourceIncluded = false;
for(int f = 0;f < int(potentialTargets.size());f++)
{
MTGCardInstance * card = ((MTGCardInstance *) potentialTargets[f]);
@@ -167,7 +165,6 @@ int AIPlayer::clickMultiTarget(TargetChooser * tc, vector<Targetable*>& potentia
clickstream.push(NEW AIAction(this, card));
DebugTrace("Ai clicked source as a target: " << (card ? card->name : "None" ) << endl );
potentialTargets.erase(potentialTargets.begin() + f);
sourceIncluded = true;
}
if(pTarget && pTarget->typeAsTarget() == TARGET_PLAYER)
{