Skip to content

Commit d648c5c

Browse files
author
Niko
committed
optimization, removes entire loop
1 parent a6eb033 commit d648c5c

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

decompile/General/Vehicle/VehBirth_0_TeleportSelf.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ void DECOMP_VehBirth_TeleportSelf(struct Driver *d, u_char spawnFlag, int spawnP
113113
// could be startline, or adv hub spawn in several places
114114
else
115115
{
116+
#if 0
116117
boolSpawnAtBossDoor = false;
117118

118119
// if you are at podium for winning a trophy
@@ -125,6 +126,7 @@ void DECOMP_VehBirth_TeleportSelf(struct Driver *d, u_char spawnFlag, int spawnP
125126
// Hub ID
126127
short* check = &data.advHubTrackIDs[(gGT->levelID - 0x1a) * 4];
127128

129+
128130
// check 4 track trophies
129131
for (int i = 0; i < 4; i++)
130132
{
@@ -157,9 +159,23 @@ void DECOMP_VehBirth_TeleportSelf(struct Driver *d, u_char spawnFlag, int spawnP
157159
// spawn outside boss door
158160
boolSpawnAtBossDoor = true;
159161
}
162+
#endif
160163

161164
// if you want to spawn outside boss door
162-
if (boolSpawnAtBossDoor)
165+
if (
166+
// After leaving a boss race
167+
(
168+
// Set in 222 EndRace function
169+
((gameMode2 & SPAWN_AT_BOSS) != 0)
170+
) ||
171+
172+
// Before starting a boss cutscene
173+
(
174+
// Just won the last trophy on the hub
175+
(gGT->podiumRewardID == 0x62) &&
176+
((gGT->currAdvProfile.numTrophies & 3) == 0)
177+
)
178+
)
163179
{
164180
// position outside boss door
165181
posRot = &level1->ptrSpawnType2_PosRot[1].posCoords[6];

0 commit comments

Comments
 (0)