Apparently the code police weren't satisfied... :) Eliminating the duplicate ints & extra assignments.

This commit is contained in:
wrenczes@gmail.com
2011-04-20 22:09:40 +00:00
parent 2a4a01da5e
commit 8e6a3e64f0
2 changed files with 2 additions and 9 deletions

View File

@@ -1251,9 +1251,7 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, Player * op
deckid = 1 + WRand() % (nbdecks);
}
sprintf(deckFile, JGE_GET_RES("ai/baka/deck%i.txt").c_str(), deckid);
int tempDeckId = deckid;
int avatarId = 0;
avatarId = tempDeckId % 100;
int avatarId = deckid % 100;
sprintf(avatarFile, "avatar%i.jpg", avatarId);
sprintf(deckFileSmall, "ai_baka_deck%i", deckid);
}

View File

@@ -70,12 +70,7 @@ void DeckMetaData::LoadStats()
// since we only have 100 stock avatar images, we need to recycle the images for deck numbers > 99
int DeckMetaData::getAvatarId()
{
if ( mDeckId < 101 )
return mDeckId;
int tempDeckId = mDeckId;
int avatarId = 0;
avatarId = tempDeckId%100;
return avatarId;
return mDeckId % 100;
}
void DeckMetaData::LoadDeck()