AltPodium for cups

We're unlikely to utilise this, but permits creators of custom user-created cups to flex their own style without fighting to replace the default Podium.
This commit is contained in:
toaster 2023-06-18 23:18:51 +01:00
parent 8689e0735e
commit 8d3e828663
3 changed files with 23 additions and 6 deletions

View file

@ -3564,6 +3564,13 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
cup->levellist[CUPCACHE_SPECIAL] = MapNameOrRemoval(word2);
cup->cachedlevels[CUPCACHE_SPECIAL] = NEXTMAP_INVALID;
}
else if (fastcmp(word, "ALTPODIUM"))
{
invalidateacrosscups(cup->cachedlevels[CUPCACHE_PODIUM]);
Z_Free(cup->levellist[CUPCACHE_PODIUM]);
cup->levellist[CUPCACHE_PODIUM] = MapNameOrRemoval(word2);
cup->cachedlevels[CUPCACHE_PODIUM] = NEXTMAP_INVALID;
}
else if (fastcmp(word, "EMERALDNUM"))
{
if (i >= 0 && i <= 14)

View file

@ -383,7 +383,8 @@ struct customoption_t
#define CUPCACHE_BONUS MAXLEVELLIST
#define MAXBONUSLIST 2
#define CUPCACHE_SPECIAL (CUPCACHE_BONUS+MAXBONUSLIST)
#define CUPCACHE_MAX (CUPCACHE_SPECIAL+1)
#define CUPCACHE_PODIUM (CUPCACHE_SPECIAL+1)
#define CUPCACHE_MAX (CUPCACHE_PODIUM+1)
#define MAXCUPNAME 16 // includes \0, for cleaner savedata

View file

@ -235,16 +235,25 @@ void K_UpdatePodiumWaypoints(player_t *const player)
--------------------------------------------------*/
boolean K_StartCeremony(void)
{
INT32 podiumMapNum = nummapheaders;
INT32 i;
if (grandprixinfo.gp == false)
{
return false;
}
if (podiummap
&& ((podiumMapNum = G_MapNumber(podiummap)) < nummapheaders)
INT32 i;
INT32 podiumMapNum = NEXTMAP_INVALID;
if (grandprixinfo.cup != NULL
&& grandprixinfo.cup->cachedlevels[CUPCACHE_PODIUM] != NEXTMAP_INVALID)
{
podiumMapNum = grandprixinfo.cup->cachedlevels[CUPCACHE_PODIUM];
}
else if (podiummap)
{
podiumMapNum = G_MapNumber(podiummap);
}
if (podiumMapNum < nummapheaders
&& mapheaderinfo[podiumMapNum]
&& mapheaderinfo[podiumMapNum]->lumpnum != LUMPERROR)
{