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
+3 -1
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);