| 233 | // int Gamesave_read_version=0; |
| 234 | |
| 235 | void IncreaseRestoreCount(const char *file) { |
| 236 | // Open the file up in read more, read the current count, then incease it |
| 237 | // and write the increased value back out. |
| 238 | |
| 239 | char countpath[_MAX_PATH * 2]; |
| 240 | CFILE *cfp; |
| 241 | |
| 242 | strcpy(countpath, file); |
| 243 | strcat(countpath, ".cnt"); |
| 244 | |
| 245 | cfp = cfopen(countpath, "rb"); |
| 246 | if (cfp) { |
| 247 | Times_game_restored = cf_ReadInt(cfp); |
| 248 | cfclose(cfp); |
| 249 | } else { |
| 250 | Times_game_restored = 0; |
| 251 | } |
| 252 | Times_game_restored++; |
| 253 | |
| 254 | cfp = cfopen(countpath, "wb"); |
| 255 | if (cfp) { |
| 256 | cf_WriteInt(cfp, Times_game_restored); |
| 257 | cfclose(cfp); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | extern bool IsRestoredGame; |
| 262 | /////////////////////////////////////////////////////////////////////////////// |
no test coverage detected