URL: <http://gna.org/patch/?916>
Summary: Fixes .sta stuff in multistat.c Project: Warzone Resurrection Project Submitted by: buginator Submitted on: Saturday 01/05/2008 at 20:13 Category: Fix Priority: 5 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: Was unsure if I should break old .sta files, or fix them in place. See comments in patch. Index: multistat.c =================================================================== --- multistat.c (revision 3351) +++ multistat.c (working copy) @@ -116,6 +116,7 @@ } else { + int num=0; loadFile(fileName,&pFileData,&size); if (strncmp(pFileData, "WZ.STA.v2", 9) != 0) @@ -123,9 +124,10 @@ return FALSE; // wrong version or not a stats file } - sscanf(pFileData, "WZ.STA.v2\n%s %u %u %u %u", - sPlayerName, &st->wins, &st->losses, &st->totalKills, &st->totalScore); - + num=sscanf(pFileData, "WZ.STA.v2\n%s %u %u %u %u %u", + sPlayerName, &st->wins, &st->losses, &st->totalKills, &st->totalScore, &st->played); + if(num < 6) // We really should check how many num if not, then reset this file & all fields + st->played = 0; //must be old format still. Or should we just return FALSE? free(pFileData); } @@ -153,8 +155,8 @@ char buffer[MAX_STA_SIZE]; char fileName[255] = ""; - snprintf(buffer, MAX_STA_SIZE, "WZ.STA.v2\n%s %u %u %u %u", - sPlayerName, st->wins, st->losses, st->totalKills, st->totalScore); + snprintf(buffer, MAX_STA_SIZE, "WZ.STA.v2\n%s %u %u %u %u %u", + sPlayerName, st->wins, st->losses, st->totalKills, st->totalScore, st->played); snprintf(fileName, sizeof(fileName), "%s%s.sta", MultiPlayersPath, sFileName); _______________________________________________________ Reply to this item at: <http://gna.org/patch/?916> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev