mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-22 10:51:54 +00:00
Add a SECTIONRACE
map flag. So far, all it does is prevent the number of laps from exceeding the map default, but it's a base to work off of if we want to add any other changes specifically for section races in future.
This commit is contained in:
parent
487a2ecf2e
commit
0ec952d019
3 changed files with 12 additions and 1 deletions
|
@ -1308,6 +1308,13 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
|||
else
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_NOZONE;
|
||||
}
|
||||
else if (fastcmp(word, "SECTIONRACE"))
|
||||
{
|
||||
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
||||
mapheaderinfo[num-1]->levelflags |= LF_SECTIONRACE;
|
||||
else
|
||||
mapheaderinfo[num-1]->levelflags &= ~LF_SECTIONRACE;
|
||||
}
|
||||
|
||||
// Individual triggers for menu flags
|
||||
else if (fastcmp(word, "HIDDEN"))
|
||||
|
@ -7943,6 +7950,7 @@ struct {
|
|||
{"LF_NOSSMUSIC",LF_NOSSMUSIC},
|
||||
{"LF_NORELOAD",LF_NORELOAD},
|
||||
{"LF_NOZONE",LF_NOZONE},
|
||||
{"LF_SECTIONRACE",LF_SECTIONRACE},
|
||||
// And map flags
|
||||
{"LF2_HIDEINMENU",LF2_HIDEINMENU},
|
||||
{"LF2_HIDEINSTATS",LF2_HIDEINSTATS},
|
||||
|
|
|
@ -272,6 +272,7 @@ typedef struct
|
|||
#define LF_NOSSMUSIC 4 ///< Disable Super Sonic music
|
||||
#define LF_NORELOAD 8 ///< Don't reload level on death
|
||||
#define LF_NOZONE 16 ///< Don't include "ZONE" on level title
|
||||
#define LF_SECTIONRACE 32 ///< Section race level
|
||||
|
||||
#define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu
|
||||
#define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen
|
||||
|
|
|
@ -2916,7 +2916,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
}
|
||||
else if (G_RaceGametype() && server)
|
||||
CV_StealthSetValue(&cv_numlaps,
|
||||
((netgame || multiplayer) && cv_basenumlaps.value)
|
||||
((netgame || multiplayer) && cv_basenumlaps.value
|
||||
&& (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)
|
||||
|| (mapheaderinfo[gamemap - 1]->numlaps > cv_basenumlaps.value)))
|
||||
? cv_basenumlaps.value
|
||||
: mapheaderinfo[gamemap - 1]->numlaps);
|
||||
|
||||
|
|
Loading…
Reference in a new issue