mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-02 05:02:55 +00:00
P_GetNextEmerald: Accomodate map reuse in GP
- In GP, use struct's cup pointer to get Emerald so the active cup ID is in control - Outside of GP, get cup pointer from map so Emerald is always the "canon" one
This commit is contained in:
parent
6ae455dbfc
commit
4b7aa368b5
1 changed files with 20 additions and 6 deletions
26
src/p_user.c
26
src/p_user.c
|
|
@ -313,15 +313,29 @@ boolean P_PlayerMoving(INT32 pnum)
|
|||
//
|
||||
UINT8 P_GetNextEmerald(void)
|
||||
{
|
||||
INT16 mapnum = gamemap-1;
|
||||
cupheader_t *cup = NULL;
|
||||
|
||||
if (mapnum > nummapheaders || !mapheaderinfo[mapnum])
|
||||
if (grandprixinfo.gp == true)
|
||||
{
|
||||
cup = grandprixinfo.cup;
|
||||
}
|
||||
|
||||
if (cup == NULL)
|
||||
{
|
||||
INT16 mapnum = gamemap-1;
|
||||
|
||||
if (mapnum < nummapheaders && mapheaderinfo[mapnum])
|
||||
{
|
||||
cup = mapheaderinfo[mapnum]->cup;
|
||||
}
|
||||
}
|
||||
|
||||
if (cup == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!mapheaderinfo[mapnum]->cup || mapheaderinfo[mapnum]->cup->cachedlevels[CUPCACHE_SPECIAL] != mapnum)
|
||||
return 0;
|
||||
|
||||
return mapheaderinfo[mapnum]->cup->emeraldnum;
|
||||
return cup->emeraldnum;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue