This commit is contained in:
yukichigai 2025-12-20 08:15:46 +01:00 committed by GitHub
commit 967aa008ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 1 deletions

View File

@ -638,7 +638,15 @@ void MakeSavedGame(tSave_game** pSave_record) {
for (i = 0; i < gNumber_of_races; i++) {
(*pSave_record)->race_info[i].been_there_done_that = gRace_list[i].been_there_done_that;
}
for (i = 0; i < gNumber_of_racers; i++) {
#ifdef DETHRACE_FIX_BUGS
// Tracking more than 48 vehicles corrupts save files.
// This only matters in modded games that add more stealable vehicles
#define VALID_SAVE_GAME_INDEX(SAVE_GAME, INDEX) ((INDEX) < gNumber_of_racers && (INDEX) < COUNT_OF((SAVE_GAME)->opponent_info))
#else
#define VALID_SAVE_GAME_INDEX(SAVE_GAME, INDEX) ((INDEX) < gNumber_of_racers)
#endif
for (i = 0; VALID_SAVE_GAME_INDEX(*pSave_record, i); i++) {
#undef VALID_SAVE_GAME_INDEX
(*pSave_record)->opponent_info[i].dead = gOpponents[i].dead;
}
(*pSave_record)->credits = gProgram_state.credits;