* Fix a number of warnings.
This commit is contained in:
jean.chalard
2009-04-29 12:06:28 +00:00
parent 789ad60723
commit e0e21fa2a3
4 changed files with 90 additions and 89 deletions
+2 -2
View File
@@ -27,10 +27,10 @@
Credits::~Credits(){ Credits::~Credits(){
SAFE_DELETE(unlockedTex); SAFE_DELETE(unlockedTex);
SAFE_DELETE(unlockedQuad); SAFE_DELETE(unlockedQuad);
for (int i=0;i<bonus.size();i++) for (unsigned int i = 0; i<bonus.size(); ++i)
if (bonus[i]) if (bonus[i])
delete bonus[i]; delete bonus[i];
bonus.clear(); bonus.clear();
} }
void Credits::compute(Player * _p1, Player * _p2, GameApp * _app){ void Credits::compute(Player * _p1, Player * _p2, GameApp * _app){
+4 -3
View File
@@ -112,14 +112,15 @@ void GameStateDuel::Start()
void GameStateDuel::loadPlayerMomir(int playerId, int isAI){ void GameStateDuel::loadPlayerMomir(int playerId, int isAI){
char * deckFile = RESPATH"/player/momir.txt"; char deckFile[] = RESPATH"/player/momir.txt";
char * deckFileSmall = "momir"; char deckFileSmall[] = "momir";
char empty[] = "";
MTGDeck * tempDeck = NEW MTGDeck(deckFile, NULL, mParent->collection); MTGDeck * tempDeck = NEW MTGDeck(deckFile, NULL, mParent->collection);
deck[playerId] = NEW MTGPlayerCards(mParent->collection,tempDeck); deck[playerId] = NEW MTGPlayerCards(mParent->collection,tempDeck);
if (!isAI){ //Human Player if (!isAI){ //Human Player
mPlayers[playerId] = NEW HumanPlayer(deck[playerId],deckFileSmall); mPlayers[playerId] = NEW HumanPlayer(deck[playerId],deckFileSmall);
}else{ }else{
mPlayers[playerId] = NEW AIMomirPlayer(deck[playerId],deckFile,""); mPlayers[playerId] = NEW AIMomirPlayer(deck[playerId],deckFile,empty);
} }
delete tempDeck; delete tempDeck;
} }
+3 -3
View File
@@ -171,9 +171,9 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
//Tap in the cost ? //Tap in the cost ?
if (line.find("{t}") != string::npos) doTap = 1; if (line.find("{t}") != string::npos) doTap = 1;
TargetChooser * tc; TargetChooser * tc = NULL;
TargetChooser * lordTargets; TargetChooser * lordTargets = NULL;
Trigger * trigger; Trigger * trigger = NULL;
while (line.size()){ while (line.size()){
string s; string s;
found = line.find("&&"); found = line.find("&&");
+1 -1
View File
@@ -120,7 +120,7 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
GameObserver *g = GameObserver::GetInstance(); GameObserver *g = GameObserver::GetInstance();
if (!from || !to) return card; //Error check if (!from || !to) return card; //Error check
if (copy = from->removeCard(card)){ if ((copy = from->removeCard(card))){
if (GameOptions::GetInstance()->values[OPTIONS_SFXVOLUME].getIntValue() > 0){ if (GameOptions::GetInstance()->values[OPTIONS_SFXVOLUME].getIntValue() > 0){
if (to == graveyard){ if (to == graveyard){