Skip to content
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 @@ -1891,9 +1891,17 @@ void LoadCar(char* pCar_name, tDriver pDriver, tCar_spec* pCar_spec, int pOwner,
int vertex_total;

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
27 changes: 27 additions & 0 deletions src/DETHRACE/common/structur.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "utility.h"
#include "world.h"
#include <stdlib.h>
#include <string.h>

// GLOBAL: CARM95 0x00509a60
int gLast_wrong_checkpoint;
Expand Down Expand Up @@ -500,6 +501,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

gAbandon_game = 0;
gDisallow_abandon_race = 0;
Expand Down Expand Up @@ -538,6 +543,28 @@ void DoGame(void) {
DoNewGameAnimation();
StartLoadingScreen();
if (gNet_mode == eNet_mode_none) {
#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();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is required, or the calls to switch resolution, or SetCarStorageTexturingLevel.

could you try without these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my first approach but it didn't look good
image

The HUD is completely misaligned and cockpit view is in lowres even when hires is enabled. After that I decided to repeat complete "science & magic" that happens on regular car change and that started to work.

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);
} else {
if (gCurrent_net_game->options.random_car_choice
Expand Down
Loading