modified debug string for card id collision

This commit is contained in:
techdragon.nguyen@gmail.com
2010-09-26 16:05:19 +00:00
parent 56a6c7b6f6
commit 7ec7fe2577
+5 -3
View File
@@ -395,7 +395,9 @@ bool MTGAllCards::addCardToCollection(MTGCard * card, int setId){
if (collection.find(newId) != collection.end()){ if (collection.find(newId) != collection.end()){
#if defined (_DEBUG) #if defined (_DEBUG)
char outBuf[4096]; char outBuf[4096];
sprintf(outBuf,"warning, card id collision! : %i -> %s (%s) \n", newId, card->data->name.c_str(), setlist.getInfo( setId )->getName().c_str()); string cardName = card->data ? card->data->name : card->getImageName();
string setName = setId != -1 ? setlist.getInfo( setId ) -> getName() : "";
sprintf(outBuf,"warning, card id collision! : %i -> %s (%s) \n", newId, cardName.c_str(), setName.c_str());
OutputDebugString(outBuf); OutputDebugString(outBuf);
#endif #endif
SAFE_DELETE(card); SAFE_DELETE(card);
@@ -816,7 +818,7 @@ MTGSetInfo* MTGSets::randomSet(int blockId, int atleast){
free(unlocked); free(unlocked);
return NULL; return NULL;
} }
int blockSize(int blockId); int blockSize(int blockId);
int MTGSets::Add(const char * name){ int MTGSets::Add(const char * name){
int setid = findSet(name); int setid = findSet(name);
@@ -965,4 +967,4 @@ void MTGSetInfo::processConfLine(string line){
block = setlist.findBlock(value.c_str()); block = setlist.findBlock(value.c_str());
else if(key.compare("year") == 0) else if(key.compare("year") == 0)
year = atoi(value.c_str()); year = atoi(value.c_str());
} }