mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Invalidate all instances of the same map across multiple cups' cachedlevels, so that it DEFINITELY will be assigned to the first cup in the linked list in P_InitMapData.
This commit is contained in:
parent
f9bdfd8a50
commit
d25e59535c
1 changed files with 25 additions and 4 deletions
|
|
@ -3021,6 +3021,28 @@ void readwipes(MYFILE *f)
|
|||
// SRB2KART
|
||||
//
|
||||
|
||||
static void invalidateacrosscups(UINT16 map)
|
||||
{
|
||||
cupheader_t *cup = kartcupheaders;
|
||||
UINT8 i;
|
||||
|
||||
if (map >= nummapheaders)
|
||||
return;
|
||||
|
||||
while (cup)
|
||||
{
|
||||
for (i = 0; i < CUPCACHE_MAX; i++)
|
||||
{
|
||||
if (cup->cachedlevels[i] != map)
|
||||
continue;
|
||||
cup->cachedlevels[i] = NEXTMAP_INVALID;
|
||||
}
|
||||
cup = cup->next;
|
||||
}
|
||||
|
||||
mapheaderinfo[map]->cup = NULL;
|
||||
}
|
||||
|
||||
void readcupheader(MYFILE *f, cupheader_t *cup)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
|
|
@ -3077,8 +3099,7 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
|
|||
cup->levellist[cup->numlevels] = NULL;
|
||||
if (cup->cachedlevels[cup->numlevels] == NEXTMAP_INVALID)
|
||||
continue;
|
||||
mapheaderinfo[cup->cachedlevels[cup->numlevels]]->cup = NULL;
|
||||
cup->cachedlevels[cup->numlevels] = NEXTMAP_INVALID;
|
||||
invalidateacrosscups(cup->cachedlevels[cup->numlevels]);
|
||||
}
|
||||
|
||||
tmp = strtok(word2,",");
|
||||
|
|
@ -3103,8 +3124,7 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
|
|||
cup->levellist[CUPCACHE_BONUS + cup->numbonus] = NULL;
|
||||
if (cup->cachedlevels[CUPCACHE_BONUS + cup->numbonus] == NEXTMAP_INVALID)
|
||||
continue;
|
||||
mapheaderinfo[cup->cachedlevels[CUPCACHE_BONUS + cup->numbonus]]->cup = NULL;
|
||||
cup->cachedlevels[CUPCACHE_BONUS + cup->numbonus] = NEXTMAP_INVALID;
|
||||
invalidateacrosscups(cup->cachedlevels[CUPCACHE_BONUS + cup->numbonus]);
|
||||
}
|
||||
|
||||
tmp = strtok(word2,",");
|
||||
|
|
@ -3122,6 +3142,7 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
|
|||
}
|
||||
else if (fastcmp(word, "SPECIALSTAGE"))
|
||||
{
|
||||
invalidateacrosscups(cup->cachedlevels[CUPCACHE_SPECIAL]);
|
||||
Z_Free(cup->levellist[CUPCACHE_SPECIAL]);
|
||||
cup->levellist[CUPCACHE_SPECIAL] = Z_StrDup(word2);
|
||||
cup->cachedlevels[CUPCACHE_SPECIAL] = NEXTMAP_INVALID;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue