Fixed "Werror" related compilation problems on Linux and Meego.
This commit is contained in:
@@ -40,4 +40,4 @@ public:
|
||||
~AIHints();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1398,7 +1398,7 @@ public:
|
||||
|
||||
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL)
|
||||
{
|
||||
if (_card == target && game->currentlyActing()->game->inPlay->hasCard(source) && (MTGCardInstance *) _card->isTapped())
|
||||
if (_card == target && game->currentlyActing()->game->inPlay->hasCard(source) && _card->isTapped())
|
||||
{
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(cost))
|
||||
{
|
||||
@@ -3289,7 +3289,6 @@ public:
|
||||
int addToGame()
|
||||
{
|
||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||
amount;
|
||||
for (int i = 0; i < amount; i++)
|
||||
{
|
||||
if (_target->controller()->opponent()->damaged() > 0)
|
||||
|
||||
@@ -53,4 +53,4 @@ public:
|
||||
~PlayRestrictions();
|
||||
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -251,4 +251,4 @@ AIAction * AIHints::suggestAbility(ManaCost * potentialMana)
|
||||
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1371,13 +1371,10 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, Player * op
|
||||
sprintf(deckFileSmall, "ai_baka_deck%i", deckid);
|
||||
}
|
||||
|
||||
int deckSetting = EASY;
|
||||
if ( opponent )
|
||||
{
|
||||
bool isOpponentAI = opponent->isAI() == 1;
|
||||
DeckMetaData *meta = DeckManager::GetInstance()->getDeckMetaDataByFilename( opponent->deckFile, isOpponentAI );
|
||||
if ( meta->getVictoryPercentage() >= 65)
|
||||
deckSetting = HARD;
|
||||
DeckManager::GetInstance()->getDeckMetaDataByFilename( opponent->deckFile, isOpponentAI );
|
||||
}
|
||||
|
||||
AIPlayerBaka * baka = NEW AIPlayerBaka(deckFile, deckFileSmall, avatarFilename);
|
||||
|
||||
@@ -758,7 +758,7 @@ int ActionStack::getActionElementFromCard(MTGCardInstance * card)
|
||||
{
|
||||
|
||||
if(!card)
|
||||
return NULL;
|
||||
return 0;
|
||||
for (size_t i = 0; i < mObjects.size(); i++)
|
||||
{
|
||||
Interruptible * current = (Interruptible *) mObjects[i];
|
||||
@@ -767,7 +767,7 @@ int ActionStack::getActionElementFromCard(MTGCardInstance * card)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Interruptible * ActionStack::getNext(Interruptible * previous, int type, int state, int display)
|
||||
|
||||
@@ -322,9 +322,7 @@ void StatsWrapper::initStatistics(string deckstats)
|
||||
gamesPlayed = stats->nbGames();
|
||||
|
||||
// Detailed deck statistics against AI
|
||||
int found = 1;
|
||||
int nbDecks = 0;
|
||||
found = 0;
|
||||
char buffer[512];
|
||||
char smallDeckName[512];
|
||||
ostringstream oss;
|
||||
@@ -334,7 +332,6 @@ void StatsWrapper::initStatistics(string deckstats)
|
||||
sprintf(buffer, "%s/%s.txt", bakaDir.c_str(), deckFilename.c_str());
|
||||
if (fileExists(buffer))
|
||||
{
|
||||
found = 1;
|
||||
nbDecks++;
|
||||
|
||||
sprintf(smallDeckName, "%s_deck%i", "ai_baka", nbDecks);
|
||||
|
||||
@@ -818,7 +818,7 @@ void GameObserver::ButtonPressed(PlayGuiObject * target)
|
||||
{
|
||||
cardClick(NULL, avatar->player);
|
||||
}
|
||||
else if (GuiPhaseBar* phaseBar = dynamic_cast<GuiPhaseBar*>(target))
|
||||
else if (dynamic_cast<GuiPhaseBar*>(target))
|
||||
{
|
||||
MTGGamePhase::GetInstance()->NextGamePhase();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ const string Options::optionNames[] = {
|
||||
int Options::getID(string name)
|
||||
{
|
||||
if (0 == name.size())
|
||||
INVALID_OPTION;
|
||||
return INVALID_OPTION;
|
||||
|
||||
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card,Player * player
|
||||
}
|
||||
|
||||
size_t typeRelated = restriction[i].find("type(");
|
||||
size_t check = NULL;
|
||||
size_t check = 0;
|
||||
if(typeRelated != string::npos)
|
||||
{
|
||||
int firstAmount = 0;
|
||||
@@ -142,7 +142,6 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card,Player * player
|
||||
check = comparasion[i].find("type(");
|
||||
if( check != string::npos)
|
||||
{
|
||||
size_t start = 0;
|
||||
size_t end = 0;
|
||||
size_t found = comparasion[i].find("type(");
|
||||
if (found != string::npos)
|
||||
|
||||
@@ -977,9 +977,8 @@ int MTGSuspendRule::reactToClick(MTGCardInstance * card)
|
||||
card->paymenttype = MTGAbility::SUSPEND_COST;
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
int payResult = player->getManaPool()->pay(card->getManaCost()->suspend);
|
||||
player->getManaPool()->pay(card->getManaCost()->suspend);
|
||||
card->getManaCost()->suspend->doPayExtra();
|
||||
payResult = ManaCost::MANA_PAID_WITH_SUSPEND;
|
||||
//---------------------------------------------------------------------------
|
||||
player->game->putInZone(card, card->currentZone, player->game->exile);
|
||||
card->next->suspended = true;
|
||||
|
||||
@@ -500,7 +500,7 @@ void OptionTheme::Render()
|
||||
{
|
||||
string temp;
|
||||
std::getline(file, temp);
|
||||
for (unsigned int x = 0; x < 17, x < temp.size(); x++)
|
||||
for (unsigned int x = 0; x < 17 && x < temp.size(); x++)
|
||||
{
|
||||
if (isprint(temp[x])) //Clear stuff that breaks mFont->DrawString, cuts to 16 chars.
|
||||
author += temp[x];
|
||||
|
||||
@@ -31,7 +31,7 @@ const KeyRep& translateKey(LocalKeySym key)
|
||||
if (!str)
|
||||
{
|
||||
str = NEW char[11];
|
||||
sprintf(str, "%lu", key); //TODO: Wagic is not supposed to know that a key actually is an unsingned long, so this part should probably be platform specific (move to JGE ?)
|
||||
sprintf(str, "%lu", (long unsigned int)key); //TODO: Wagic is not supposed to know that a key actually is an unsingned long, so this part should probably be platform specific (move to JGE ?)
|
||||
}
|
||||
const KeyRep k = make_pair(str, static_cast<JQuad*>(NULL));
|
||||
fattable[key] = k;
|
||||
|
||||
@@ -1550,7 +1550,7 @@ WDistort::WDistort(float x1, float y1, float x2, float y2, float x3, float y3, f
|
||||
|
||||
void WGuiListRow::Render()
|
||||
{
|
||||
int start = 0, nowPos = 0, vHeight = 0;
|
||||
int start = 0, nowPos = 0;
|
||||
int nbitems = (int) items.size();
|
||||
|
||||
//List is empty.
|
||||
@@ -1576,7 +1576,6 @@ void WGuiListRow::Render()
|
||||
}
|
||||
}
|
||||
|
||||
vHeight = 0;
|
||||
nowPos = 4;
|
||||
float nowVPos = 4;
|
||||
float tallestRow = 0;
|
||||
|
||||
Reference in New Issue
Block a user