Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix APC/BIGAPC wheels when player wasted equivalent cop car in previous race #428

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/DETHRACE/common/loading.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,8 +1745,16 @@ void LoadCar(char* pCar_name, tDriver pDriver, tCar_spec* pCar_spec, int pOwner,
LOG_TRACE("(\"%s\", %d, %p, %d, \"%s\", %p)", pCar_name, pDriver, pCar_spec, pOwner, pDriver_name, pStorage_space);

if (pDriver == eDriver_local_human) {
#if defined(DETHRACE_FIX_BUGS)
// Player's APC/BIGAPC wheels got stuck if the equivalent cop car was wasted in previous race
if (strcmp(gProgram_state.car_name, pCar_name) == 0 &&
strcmp(gProgram_state.car_name, "APC.TXT") != 0 &&
strcmp(gProgram_state.car_name, "BIGAPC.TXT") != 0)
return;
#else
if (strcmp(gProgram_state.car_name, pCar_name) == 0)
return;
#endif
if (gProgram_state.car_name[0] != '\0') {
DisposeCar(&gProgram_state.current_car, gProgram_state.current_car.index);
ClearOutStorageSpace(&gOur_car_storage_space);
Expand Down
26 changes: 26 additions & 0 deletions src/DETHRACE/common/structur.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ void DoGame(void) {
int second_select_race;
int first_summary_done;
int i;
#if defined(DETHRACE_FIX_BUGS)
// Player's APC/BIGAPC wheels got stuck if the equivalent cop car was wasted in previous race
int power_up_levels[3];
#endif
LOG_TRACE("()");

gAbandon_game = 0;
Expand Down Expand Up @@ -523,6 +527,28 @@ void DoGame(void) {
SwapNetCarsLoad();
}
} else {
#if defined(DETHRACE_FIX_BUGS)
// Player's APC/BIGAPC wheels got stuck if the equivalent cop car was wasted in previous race
if(strcmp(gProgram_state.car_name, "APC.TXT") == 0 ||
strcmp(gProgram_state.car_name, "BIGAPC.TXT") == 0) {
AboutToLoadFirstCar();
SwitchToRealResolution();
for (i = 0; i < COUNT_OF(power_up_levels); i++) {
power_up_levels[i] = gProgram_state.current_car.power_up_levels[i];
}
LoadCar(gOpponents[gProgram_state.cars_available[gCurrent_car_index]].car_file_name,
eDriver_local_human,
&gProgram_state.current_car,
gProgram_state.cars_available[gCurrent_car_index],
gProgram_state.player_name[gProgram_state.frank_or_anniness],
&gOur_car_storage_space);
for (i = 0; i < COUNT_OF(power_up_levels); i++) {
gProgram_state.current_car.power_up_levels[i] = power_up_levels[i];
}
SwitchToLoresMode();
SetCarStorageTexturingLevel(&gOur_car_storage_space, GetCarTexturingLevel(), eCTL_full);
}
#endif
LoadOpponentsCars(&gCurrent_race);
}
PrintMemoryDump(0, "AFTER LOADING OPPONENTS IN");
Expand Down
Loading