Change all gametyperules uses to gametypes[gametype]->rules

This commit is contained in:
NepDisk 2026-03-10 21:14:23 -04:00
parent ee80e52e56
commit cd2d07b190
25 changed files with 192 additions and 195 deletions

View file

@ -3414,7 +3414,7 @@ void D_SetupVote(void)
else
WRITEUINT8(p, gt);
if (cv_kartencore.value && cv_encorevotes.value == 0 && (gametyperules & GTR_CIRCUIT))
if (cv_kartencore.value && cv_encorevotes.value == 0 && (gametypes[gametype]->rules & GTR_CIRCUIT))
WRITEUINT8(p, secondgt|VOTEMODIFIER_ENCORE);
else
WRITEUINT8(p, secondgt);
@ -3917,7 +3917,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
else if (gametype != lastgametype)
D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype
if (!(gametyperules & GTR_ENCORE) && !bossinfo.boss)
if (!(gametypes[gametype]->rules & GTR_ENCORE) && !bossinfo.boss)
pencoremode = false;
skipprecutscene = ((flags & (1<<2)) != 0);
@ -4768,7 +4768,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
{
players[playernum].spectatorreentry = (cv_spectatorreentry.value * TICRATE);
if (gametyperules & GTR_BUMPERS) // SRB2kart
if (gametypes[gametype]->rules & GTR_BUMPERS) // SRB2kart
{
players[playernum].roundscore = 0;
if (K_IsPlayerWanted(&players[playernum]))
@ -6001,7 +6001,7 @@ static void PointLimit_OnChange(void)
}
// Don't allow pointlimit in non-pointlimited gametypes!
if (server && Playing() && !(gametyperules & GTR_POINTLIMIT))
if (server && Playing() && !(gametypes[gametype]->rules & GTR_POINTLIMIT))
{
if (cv_pointlimit.value)
CV_StealthSetValue(&cv_pointlimit, 0);

View file

@ -531,9 +531,6 @@ enum GameTypeRules
// free: to and including 1<<31
};
// TODO: replace every instance
#define gametyperules (gametypes[gametype]->rules)
// TypeOfLevel things
enum TypeOfLevel
{

View file

@ -2220,7 +2220,7 @@ boolean G_CouldView(INT32 playernum)
return false;
// I don't know if we want this actually, but I'll humor the suggestion anyway
if ((gametyperules & GTR_BUMPERS) && !demo.playback)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && !demo.playback)
{
if (player->bumper <= 0)
return false;
@ -2962,7 +2962,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
itemamount = 0;
growshrinktimer = 0;
bubblehealth = 0;
bumper = ((gametyperules & GTR_BUMPERS) ? K_StartingBumperCount() : 0);
bumper = ((gametypes[gametype]->rules & GTR_BUMPERS) ? K_StartingBumperCount() : 0);
karmapoints = 0;
wanted = 0;
rings = cv_kartringsstart.value;
@ -3370,7 +3370,7 @@ mapthing_t *G_FindTeamStart(INT32 playernum)
if (!numredctfstarts && !numbluectfstarts) //why even bother, eh?
{
if ((gametyperules & GTR_TEAMSTARTS) && doprints)
if ((gametypes[gametype]->rules & GTR_TEAMSTARTS) && doprints)
CONS_Alert(CONS_WARNING, M_GetText("No CTF starts in this map!\n"));
return NULL;
}
@ -3450,7 +3450,7 @@ mapthing_t *G_FindBattleStart(INT32 playernum)
}
}
if ((gametyperules & GTR_BATTLESTARTS) && doprints)
if ((gametypes[gametype]->rules & GTR_BATTLESTARTS) && doprints)
CONS_Alert(CONS_WARNING, M_GetText("No Deathmatch starts in this map!\n"));
return NULL;
}
@ -3599,7 +3599,7 @@ mapthing_t *G_FindMapStart(INT32 playernum)
{
// In platform gametypes, spawn in Co-op starts first
// Overriden by GTR_BATTLESTARTS.
if (gametyperules & GTR_BATTLESTARTS && bossinfo.boss == false)
if (gametypes[gametype]->rules & GTR_BATTLESTARTS && bossinfo.boss == false)
spawnpoint = G_FindBattleStartOrFallback(playernum);
else
spawnpoint = G_FindRaceStartOrFallback(playernum);
@ -3612,12 +3612,12 @@ mapthing_t *G_FindMapStart(INT32 playernum)
// -- CTF --
// Order: CTF->DM->Race
else if ((gametyperules & GTR_TEAMSTARTS) && players[playernum].ctfteam)
else if ((gametypes[gametype]->rules & GTR_TEAMSTARTS) && players[playernum].ctfteam)
spawnpoint = G_FindTeamStartOrFallback(playernum);
// -- DM/Tag/CTF-spectator/etc --
// Order: DM->CTF->Race
else if (gametyperules & GTR_BATTLESTARTS)
else if (gametypes[gametype]->rules & GTR_BATTLESTARTS)
spawnpoint = G_FindBattleStartOrFallback(playernum);
// -- Other game modes --
@ -4096,12 +4096,12 @@ boolean G_GametypeUsesLives(void)
//
boolean G_GametypeHasTeams(void)
{
if (gametyperules & GTR_TEAMS)
if (gametypes[gametype]->rules & GTR_TEAMS)
{
// Teams forced on by this gametype
return true;
}
else if (gametyperules & GTR_NOTEAMS)
else if (gametypes[gametype]->rules & GTR_NOTEAMS)
{
// Teams forced off by this gametype
return false;
@ -4873,7 +4873,7 @@ static void G_DoCompleted(void)
}
// See Y_StartIntermission timer handling
if ((gametyperules & GTR_CIRCUIT) && ((multiplayer && demo.playback) || j == r_splitscreen+1) && (!K_CanChangeRules(false) || cv_inttime.value > 0))
if ((gametypes[gametype]->rules & GTR_CIRCUIT) && ((multiplayer && demo.playback) || j == r_splitscreen+1) && (!K_CanChangeRules(false) || cv_inttime.value > 0))
// play some generic music if there's no win/cool/lose music going on (for exitlevel commands)
{
S_ChangeMusicInternal("racent", true);

View file

@ -2549,9 +2549,9 @@ static void HU_DrawRankings(void)
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, (modeattacking) ? "Record Attack" : gametype_cons_t[gametype].strvalue);
}
if ((gametyperules & (GTR_TIMELIMIT|GTR_POINTLIMIT)) && !bossinfo.boss)
if ((gametypes[gametype]->rules & (GTR_TIMELIMIT|GTR_POINTLIMIT)) && !bossinfo.boss)
{
if ((gametyperules & GTR_TIMELIMIT) && timelimitintics > 0)
if ((gametypes[gametype]->rules & GTR_TIMELIMIT) && timelimitintics > 0)
{
UINT32 timeval = (timelimitintics + starttime + 1 - leveltime);
if (timeval > timelimitintics+1)
@ -2572,7 +2572,7 @@ static void HU_DrawRankings(void)
}
}
if ((gametyperules & GTR_POINTLIMIT) && cv_pointlimit.value > 0)
if ((gametypes[gametype]->rules & GTR_POINTLIMIT) && cv_pointlimit.value > 0)
{
V_DrawCenteredString(256, 8, 0, "POINT LIMIT");
V_DrawCenteredString(256, 16, hilicol, va("%d", cv_pointlimit.value));
@ -2632,7 +2632,7 @@ static void HU_DrawRankings(void)
tab[scorelines].name = player_names[i];
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
if (!players[i].exiting)
sprintf(tab[scorelines].string, "Lap %d", players[i].laps);
@ -2645,7 +2645,7 @@ static void HU_DrawRankings(void)
sprintf(tab[scorelines].string, "%i'%02i\"%02i", min, sec, cen);
}
}
else if (gametyperules & GTR_POINTS)
else if (gametypes[gametype]->rules & GTR_POINTS)
sprintf(tab[scorelines].string, "%d", players[i].roundscore);
scorelines++;

View file

@ -42,7 +42,7 @@ boolean K_IsPlayerWanted(player_t *player)
{
UINT8 i;
if (!(gametyperules & GTR_WANTED))
if (!(gametypes[gametype]->rules & GTR_WANTED))
return false;
for (i = 0; i < 4; i++)
@ -60,7 +60,7 @@ boolean K_IsPlayerMostWanted(player_t *player)
if (mostwanted == -1)
return false;
if (!(gametyperules & GTR_WANTEDSPB))
if (!(gametypes[gametype]->rules & GTR_WANTEDSPB))
return false;
if (player == &players[mostwanted])
@ -78,7 +78,7 @@ void K_CalculateBattleWanted(void)
mostwanted = -1;
if (!(gametyperules & GTR_WANTED))
if (!(gametypes[gametype]->rules & GTR_WANTED))
{
memset(battlewanted, -1, sizeof (battlewanted));
return;
@ -227,7 +227,7 @@ void K_CheckBumpers(void)
UINT32 winnerscoreadd = 0, maxroundscore = 0;
boolean nobumpers = false;
if (!(gametyperules & GTR_BUMPERS))
if (!(gametypes[gametype]->rules & GTR_BUMPERS))
return;
if (gameaction == ga_completed)
@ -355,7 +355,7 @@ void K_RunPaperItemSpawners(void)
}
if ((players[i].exiting > 0 || (players[i].pflags & PF_ELIMINATED))
|| ((gametyperules & GTR_BUMPERS) && players[i].bumper <= 0))
|| ((gametypes[gametype]->rules & GTR_BUMPERS) && players[i].bumper <= 0))
{
continue;
}
@ -489,7 +489,7 @@ void K_SpawnPlayerBattleBumpers(player_t *p)
void K_BattleInit(boolean singleplayercontext)
{
if ((gametyperules & GTR_ITEMBREAKER) && singleplayercontext && !itembreaker && !bossinfo.boss)
if ((gametypes[gametype]->rules & GTR_ITEMBREAKER) && singleplayercontext && !itembreaker && !bossinfo.boss)
{
if (!(K_CanChangeRules(true) && !cv_kartitembreaker.value))
itembreaker = true;
@ -501,7 +501,7 @@ void K_BattleInit(boolean singleplayercontext)
}
}
if (gametyperules & GTR_BUMPERS)
if (gametypes[gametype]->rules & GTR_BUMPERS)
{
INT32 maxbumpers = K_StartingBumperCount();
UINT8 i;
@ -519,7 +519,7 @@ void K_BattleInit(boolean singleplayercontext)
// Handle respawning the battle boxes.
void K_RespawnBattleBoxes(void)
{
if (!(gametyperules & GTR_BATTLEBOXES))
if (!(gametypes[gametype]->rules & GTR_BATTLEBOXES))
return;
if (itembreaker)

View file

@ -263,7 +263,7 @@ void K_UpdateMatchRaceBots(void)
{
difficulty = 0;
}
else if ((gametyperules & GTR_BOTS) == 0 && !cv_forcebots.value)
else if ((gametypes[gametype]->rules & GTR_BOTS) == 0 && !cv_forcebots.value)
{
difficulty = 0;
}
@ -1608,7 +1608,7 @@ void K_BotTicker(const player_t *player)
bd->itemthrow = 0;
boolean onground = P_IsObjectOnGround(player->mo);
if (!(gametyperules & GTR_BOTS) // No bot behaviors
if (!(gametypes[gametype]->rules & GTR_BOTS) // No bot behaviors
|| K_GetNumWaypoints() == 0 // No waypoints
|| leveltime <= introtime // During intro camera
|| player->playerstate == PST_DEAD // Dead, respawning.

View file

@ -253,7 +253,7 @@ boolean K_EggItemCollide(mobj_t *t1, mobj_t *t2)
if (!P_CanPickupItem(t2->player, PICKUPITEM_EGGMAN))
return true;
if ((gametyperules & GTR_BUMPERS) && t2->player->bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && t2->player->bumper <= 0)
{
if (t2->player->karmamode || t2->player->karmadelay)
return true;
@ -288,7 +288,7 @@ boolean K_EggItemCollide(mobj_t *t1, mobj_t *t2)
if (t1->target && t1->target->player)
{
if ((gametyperules & GTR_CIRCUIT) || t1->target->player->bumper > 0)
if ((gametypes[gametype]->rules & GTR_CIRCUIT) || t1->target->player->bumper > 0)
t2->player->eggmanblame = t1->target->player-players;
else
t2->player->eggmanblame = t2->player-players;
@ -1111,7 +1111,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
// Battle Mode Sneaker damage
// (Pogo Spring damage is handled in head-stomping code)
if (gametyperules & GTR_BUMPERS)
if (gametypes[gametype]->rules & GTR_BUMPERS)
{
t1Condition = ((t1->player->sneakertimer > 0)
&& !P_PlayerInPain(t1->player)

View file

@ -52,7 +52,7 @@ static INT32 K_PlayersPlaying(void)
static inline boolean race_rules(void)
{
return (gametyperules & GTR_CIRCUIT);
return (gametypes[gametype]->rules & GTR_CIRCUIT);
}
static fixed_t ScaleFromMap(fixed_t n, fixed_t scale)

View file

@ -789,7 +789,7 @@ boolean K_BotDefaultSpectator(void)
return false;
}
if (!(gametyperules & GTR_BOTS))
if (!(gametypes[gametype]->rules & GTR_BOTS))
{
// This gametype does not support bots.
return true;

View file

@ -2256,7 +2256,7 @@ static boolean K_drawKartPositionFaces(void)
if (LUA_HudEnabled(hud_battlebumpers))
{
if ((gametyperules & GTR_BUMPERS) && players[rankplayer[i]].bumper > 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && players[rankplayer[i]].bumper > 0)
{
V_DrawMappedPatch(bumperx-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_tinybumper[0], colormap);
for (j = 1; j < players[rankplayer[i]].bumper; j++)
@ -2294,7 +2294,7 @@ static boolean K_drawKartPositionFaces(void)
V_DrawScaledPatch(FACE_X+left, Y+top, V_HUDTRANS|V_SNAPTOLEFT, highlight);
}
if ((gametyperules & GTR_BUMPERS) && players[rankplayer[i]].bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && players[rankplayer[i]].bumper <= 0)
V_DrawScaledPatch(FACE_X-4, Y-3, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknobumpers);
else
{
@ -2529,7 +2529,7 @@ INT32 K_DrawNeoTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines
colormap
);
/*if ((gametyperules & GTR_BUMPERS) && players[tab[i].num].bumper > 0) -- not enough space for this
/*if ((gametypes[gametype]->rules & GTR_BUMPERS) && players[tab[i].num].bumper > 0) -- not enough space for this
{
INT32 bumperx = x+19;
V_DrawMappedPatch(bumperx-2, y-4, 0, kp_tinybumper[0], colormap);
@ -2552,7 +2552,7 @@ INT32 K_DrawNeoTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines
NULL
);
if ((gametyperules & GTR_BUMPERS) && players[tab[i].num].bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && players[tab[i].num].bumper <= 0)
V_DrawScaledPatch(x2-4, y-7, 0, kp_ranknobumpers);
if (tab[i].string[0] != '\0')
@ -2782,7 +2782,7 @@ void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, IN
V_DrawMappedPatch(x+facerank->leftoffset, y-4+facerank->topoffset, 0, facerank, colormap);
/*if ((gametyperules & GTR_BUMPERS) && players[tab[i].num].bumper > 0) -- not enough space for this
/*if ((gametypes[gametype]->rules & GTR_BUMPERS) && players[tab[i].num].bumper > 0) -- not enough space for this
{
INT32 bumperx = x+19;
V_DrawMappedPatch(bumperx-2, y-4, 0, kp_tinybumper[0], colormap);
@ -2799,7 +2799,7 @@ void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, IN
V_DrawScaledPatch(x+highlight->leftoffset, y-4+highlight->topoffset, 0, highlight);
}
if ((gametyperules & GTR_BUMPERS) && players[tab[i].num].bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && players[tab[i].num].bumper <= 0)
V_DrawScaledPatch(x-4, y-7, 0, kp_ranknobumpers);
else
{
@ -3014,7 +3014,7 @@ static void K_drawKartAccessibilityIcons(INT32 fx)
if ((cv_newspeedometer.value == 0 || cv_newspeedometer.value == 2) && !K_RingsActive())
fy += 18;
if ((gametyperules & GTR_BUMPERS) && !(gametyperules & GTR_CIRCUIT))
if ((gametypes[gametype]->rules & GTR_BUMPERS) && !(gametypes[gametype]->rules & GTR_CIRCUIT))
fy -= 4;
}
}
@ -3105,7 +3105,7 @@ static void K_drawKartSpeedometer(void)
if (cv_speed_xoffset.value == 0 && cv_speed_yoffset.value == 0)
{
if ((gametyperules & GTR_BUMPERS) && !(gametyperules & GTR_CIRCUIT))
if ((gametypes[gametype]->rules & GTR_BUMPERS) && !(gametypes[gametype]->rules & GTR_CIRCUIT))
battleoffset = -4;
if (K_RingsActive() == true)
@ -3234,7 +3234,7 @@ static void K_drawRingMeter(void)
if (cv_speed_xoffset.value == 0 && cv_speed_yoffset.value == 0)
{
if ((gametyperules & GTR_BUMPERS) && !(gametyperules & GTR_CIRCUIT))
if ((gametypes[gametype]->rules & GTR_BUMPERS) && !(gametypes[gametype]->rules & GTR_CIRCUIT))
ringoffsety -= 4;
if (itembreaker)
@ -3352,7 +3352,7 @@ static void K_drawKartBumpersOrKarma(void)
}
else
{
if (stplyr->bumper <= 0 && (gametyperules & GTR_KARMA) && comeback)
if (stplyr->bumper <= 0 && (gametypes[gametype]->rules & GTR_KARMA) && comeback)
{
V_DrawMappedPatch(fx, fy-1, V_HUDTRANS|splitflags, kp_splitkarmabomb, colormap);
V_DrawScaledPatch(fx+13, fy, V_HUDTRANS|splitflags, kp_facenum[stplyr->karmapoints % 10]);
@ -3459,7 +3459,7 @@ static void K_drawKartWanted(void)
basex -= 48;
// Position Number offset....
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
basex -= 30;
}
}
@ -3626,7 +3626,7 @@ static boolean K_ShowPlayerNametag(player_t *p)
return false;
}
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
if ((p->position == 0)
|| (stplyr->position == 0)
@ -4359,7 +4359,7 @@ static void K_drawKartMinimap(void)
}
// Now we know it's not a display player, handle non-local player exceptions.
if ((gametyperules & GTR_BUMPERS) && players[i].bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && players[i].bumper <= 0)
continue;
if (players[i].hyudorotimer > 0)
@ -4563,7 +4563,7 @@ static void K_drawKartMinimap(void)
// Target reticule
if ((gametype == GT_RACE && players[i].position == spbplace)
|| ((gametyperules & GTR_WANTED) && K_IsPlayerWanted(&players[i])))
|| ((gametypes[gametype]->rules & GTR_WANTED) && K_IsPlayerWanted(&players[i])))
{
K_drawKartMinimapIcon(interpx, interpy, x, y, splitflags, kp_wantedreticle, NULL, NULL);
}
@ -4916,7 +4916,7 @@ static void K_drawKartMinimap(void)
// Target reticule
if ((gametype == GT_RACE && players[localplayers[i]].position == spbplace)
|| ((gametyperules & GTR_WANTED) && K_IsPlayerWanted(&players[localplayers[i]])))
|| ((gametypes[gametype]->rules & GTR_WANTED) && K_IsPlayerWanted(&players[localplayers[i]])))
{
K_drawKartMinimapIcon(interpx, interpy, x, y, splitflags, kp_wantedreticle, NULL, NULL);
}
@ -6121,7 +6121,7 @@ void K_drawKartHUD(void)
return;
}
battlefullscreen = ((gametyperules & (GTR_BUMPERS|GTR_KARMA)) == (GTR_BUMPERS|GTR_KARMA)
battlefullscreen = ((gametypes[gametype]->rules & (GTR_BUMPERS|GTR_KARMA)) == (GTR_BUMPERS|GTR_KARMA)
&& (stplyr->exiting
|| (stplyr->bumper <= 0
&& stplyr->karmadelay > 0
@ -6141,7 +6141,7 @@ void K_drawKartHUD(void)
K_drawKartNameTags();
// Draw WANTED status
if (gametyperules & GTR_WANTED)
if (gametypes[gametype]->rules & GTR_WANTED)
{
if (LUA_HudEnabled(hud_wanted))
K_drawKartWanted();
@ -6228,7 +6228,7 @@ void K_drawKartHUD(void)
{
K_drawBossHealthBar();
}
else if (gametyperules & GTR_CIRCUIT) // Race-only elements
else if (gametypes[gametype]->rules & GTR_CIRCUIT) // Race-only elements
{
if (!islonesome)
{
@ -6240,12 +6240,12 @@ void K_drawKartHUD(void)
if (LUA_HudEnabled(hud_gametypeinfo))
{
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
K_drawKartLaps();
K_drawKartStatsnLives();
}
else if (gametyperules & GTR_BUMPERS)
else if (gametypes[gametype]->rules & GTR_BUMPERS)
{
K_drawKartBumpersOrKarma();
}
@ -6276,7 +6276,7 @@ void K_drawKartHUD(void)
}
// Draw the countdowns after everything else.
if (!(gametyperules & GTR_NOCOUNTDOWN) && starttime != introtime
if (!(gametypes[gametype]->rules & GTR_NOCOUNTDOWN) && starttime != introtime
&& leveltime >= introtime
&& leveltime < starttime+TICRATE)
{
@ -6296,7 +6296,7 @@ void K_drawKartHUD(void)
}
// Race overlays
if ((gametyperules & GTR_CIRCUIT) && !freecam)
if ((gametypes[gametype]->rules & GTR_CIRCUIT) && !freecam)
{
if (stplyr->exiting)
K_drawKartFinish();
@ -6311,7 +6311,7 @@ void K_drawKartHUD(void)
return;
// TODO: Make this slide like the other titlecards
if ((gametyperules & GTR_KARMA) && !r_splitscreen && stplyr->karthud[khud_yougotem]) // * YOU GOT EM *
if ((gametypes[gametype]->rules & GTR_KARMA) && !r_splitscreen && stplyr->karthud[khud_yougotem]) // * YOU GOT EM *
V_DrawScaledPatch(BASEVIDWIDTH/2 - (kp_yougotem->width/2), 32, V_HUDTRANS, kp_yougotem);
// Draw FREE PLAY.

View file

@ -215,7 +215,7 @@ private:
bool is_player_tracking_target(player_t *player = stplyr)
{
if ((gametyperules & (GTR_BUMPERS|GTR_CLOSERPLAYERS)) != (GTR_BUMPERS|GTR_CLOSERPLAYERS))
if ((gametypes[gametype]->rules & (GTR_BUMPERS|GTR_CLOSERPLAYERS)) != (GTR_BUMPERS|GTR_CLOSERPLAYERS))
{
return false;
}

View file

@ -293,7 +293,7 @@ static boolean K_RaceForceSPB(SINT8 playerpos, UINT32 pdis)
return false;
}
return ((gametyperules & GTR_CIRCUIT) && playerpos == 2 && pdis > (UINT32)(7 * spb_res->augcvar[idx]->value / 2));
return ((gametypes[gametype]->rules & GTR_CIRCUIT) && playerpos == 2 && pdis > (UINT32)(7 * spb_res->augcvar[idx]->value / 2));
}
// 1/21/2025: I hate tiptoeing around the integer limit.
@ -541,7 +541,7 @@ void K_UpdateItemCooldown(void)
if (!playeringame[i] || player->spectator || player->exiting > 0)
continue;
if (gametyperules & GTR_BUMPERS && player->bumper == 0)
if (gametypes[gametype]->rules & GTR_BUMPERS && player->bumper == 0)
continue;
// special case for legacy shrink
@ -585,7 +585,7 @@ void K_UpdateItemCooldown(void)
{
kartresult_t *result = &kartresults[i];
if (result->isalt == K_IsKartItemAlternate(result->type)
&& (gametyperules & GTR_RACEODDS || result->flags & KRF_INDIRECTITEM)
&& (gametypes[gametype]->rules & GTR_RACEODDS || result->flags & KRF_INDIRECTITEM)
&& setcooldown[result->type])
result->cooldown = result->basecooldown;
}
@ -654,16 +654,16 @@ static INT32 GetItemOdds(kartroulette_t *roulette, kartresult_t *result, UINT8 *
// Item type used for actual odds retrieval and cooldown assignments.
UINT8 oddstable;
if (gametyperules & GTR_BATTLEODDS)
if (gametypes[gametype]->rules & GTR_BATTLEODDS)
oddstable = ODDS_BATTLE;
else if (gametyperules & GTR_RACEODDS)
else if (gametypes[gametype]->rules & GTR_RACEODDS)
oddstable = ODDS_RACE;
else
oddstable = ODDS_SPECIAL;
I_Assert(roulette->pos < oddstablemax[oddstable]); // DO NOT allow positions past the bounds of the table
if (gametyperules & GTR_BATTLEODDS)
if (gametypes[gametype]->rules & GTR_BATTLEODDS)
oddsmul = BATTLEODDSMUL;
// TODO: braaap (make a separate table for the current level!)
@ -683,7 +683,7 @@ static INT32 GetItemOdds(kartroulette_t *roulette, kartresult_t *result, UINT8 *
if (!playeringame[i] || players[i].spectator)
continue;
if (!(gametyperules & GTR_BUMPERS) || players[i].bumper)
if (!(gametypes[gametype]->rules & GTR_BUMPERS) || players[i].bumper)
roulette->pingame++;
if (players[i].exiting)
@ -937,7 +937,7 @@ UINT8 K_FindUseodds(const player_t *player, fixed_t mashed, UINT32 pdis, UINT8 b
{
boolean available = false;
if ((gametyperules & GTR_BATTLEODDS) && i > 1)
if ((gametypes[gametype]->rules & GTR_BATTLEODDS) && i > 1)
{
oddsvalid[i] = false;
break;
@ -966,7 +966,7 @@ UINT8 K_FindUseodds(const player_t *player, fixed_t mashed, UINT32 pdis, UINT8 b
distlen = min(sizeof(disttable) - 1, distlen); \
}
if (gametyperules & GTR_BATTLEODDS) // Battle Mode
if (gametypes[gametype]->rules & GTR_BATTLEODDS) // Battle Mode
{
if (player->roulettetype == KROULETTETYPE_KARMA && oddsvalid[1] == true)
{
@ -984,7 +984,7 @@ UINT8 K_FindUseodds(const player_t *player, fixed_t mashed, UINT32 pdis, UINT8 b
}
}
}
else if (gametyperules & GTR_RACEODDS)
else if (gametypes[gametype]->rules & GTR_RACEODDS)
{
INT32 tablediv = FixedMul(2, oddsfac);
@ -1080,7 +1080,7 @@ UINT8* K_GetRollableItems(void)
roulette_size = 0;
if (gametyperules & GTR_BATTLEODDS)
if (gametypes[gametype]->rules & GTR_BATTLEODDS)
oddstable = ODDS_BATTLE;
else
oddstable = ODDS_RACE;
@ -1317,7 +1317,7 @@ UINT32 K_CalculatePDIS(const player_t *player, UINT8 numPlayers, boolean *spbrus
static boolean K_BattleForceSPB(player_t *player)
{
boolean battlecond = ((gametyperules & GTR_WANTED) && (gametyperules & GTR_WANTEDSPB) && (mostwanted != -1) && (!K_IsPlayerMostWanted(player)));
boolean battlecond = ((gametypes[gametype]->rules & GTR_WANTED) && (gametypes[gametype]->rules & GTR_WANTEDSPB) && (mostwanted != -1) && (!K_IsPlayerMostWanted(player)));
return battlecond;
}
@ -1415,7 +1415,7 @@ void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
// SPECIAL CASE No. 3:
// This Gametype never specified an odds type. Roll something random please!
if (!(gametyperules & GTR_RACEODDS) && !(gametyperules & GTR_BATTLEODDS))
if (!(gametypes[gametype]->rules & GTR_RACEODDS) && !(gametypes[gametype]->rules & GTR_BATTLEODDS))
{
UINT8 itemroll = P_RandomRange(0, numkartresults - 1);
K_AwardPlayerResult(player, &kartresults[itemroll], KITEMBLINK_NORMAL);
@ -1425,10 +1425,10 @@ void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
// SPECIAL CASE No. 4:
// Record Attack / alone mashing behavior
if ((modeattacking || pingame == 1)
&& ((gametyperules & GTR_RACEODDS)
|| ((gametyperules & GTR_BATTLEODDS) && (itembreaker || bossinfo.boss))))
&& ((gametypes[gametype]->rules & GTR_RACEODDS)
|| ((gametypes[gametype]->rules & GTR_BATTLEODDS) && (itembreaker || bossinfo.boss))))
{
if ((gametyperules & GTR_RACEODDS))
if ((gametypes[gametype]->rules & GTR_RACEODDS))
{
if (mashed && (K_ItemResultEnabled(K_GetKartResult("superring")) || (modeattacking && K_RingsActive()))) // ANY mashed value? You get rings.
{
@ -1442,7 +1442,7 @@ void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
K_AwardPlayerResult(player, NULL, KITEMBLINK_NORMAL);
}
}
else if (gametyperules & GTR_BATTLEODDS)
else if (gametypes[gametype]->rules & GTR_BATTLEODDS)
{
if (mashed && (bossinfo.boss || K_ItemResultEnabled(K_GetKartResult("banana"))) && !itembreaker) // ANY mashed value? You get a banana.
K_AwardPlayerResult(player, K_GetKartResult("banana"), KITEMBLINK_MASHED);
@ -1650,7 +1650,7 @@ static void K_DoGrowShrink(player_t *player, boolean shrinking)
}
else
{
player->growshrinktimer = (gametyperules & GTR_CLOSERPLAYERS ? 8 : 12) * ((shrinking) ? -TICRATE : TICRATE);
player->growshrinktimer = (gametypes[gametype]->rules & GTR_CLOSERPLAYERS ? 8 : 12) * ((shrinking) ? -TICRATE : TICRATE);
}
if (shrinking)
@ -1773,7 +1773,7 @@ static void K_DoHyudoroSteal(player_t *player)
// Can steal from this player
&& (gametype == GT_RACE //&& players[i].position < player->position)
|| ((gametyperules & GTR_BUMPERS) && players[i].bumper > 0))
|| ((gametypes[gametype]->rules & GTR_BUMPERS) && players[i].bumper > 0))
// Has an item
&& (players[i].itemtype

View file

@ -139,7 +139,7 @@ void K_TimerInit(void)
introtime = (108) + 5; // 108 for rotation, + 5 for white fade
starttime = 6*TICRATE + (3*TICRATE/4);
if (gametyperules & GTR_NOCOUNTDOWN)
if (gametypes[gametype]->rules & GTR_NOCOUNTDOWN)
{
starttime = 0;
}
@ -147,7 +147,7 @@ void K_TimerInit(void)
K_BattleInit(domodeattack);
if ((gametyperules & GTR_TIMELIMIT) && !bossinfo.boss && !modeattacking)
if ((gametypes[gametype]->rules & GTR_TIMELIMIT) && !bossinfo.boss && !modeattacking)
{
if (!K_CanChangeRules(true))
{
@ -1126,7 +1126,7 @@ static void K_UpdateDraft(player_t *player)
minDist = cv_kartdrafting_closedeadzone.value * player->mo->scale;
if (gametyperules & GTR_CLOSERPLAYERS)
if (gametypes[gametype]->rules & GTR_CLOSERPLAYERS)
{
minDist /= 4;
draftdistance *= 2;
@ -1221,7 +1221,7 @@ static void K_UpdateDraft(player_t *player)
fixed_t add = (FRACUNIT/200) + ((9 - player->kartspeed+(player->kartspeed/3)) * ((3*FRACUNIT)/1600));
player->draftpower += add;
if (gametyperules & GTR_CLOSERPLAYERS)
if (gametypes[gametype]->rules & GTR_CLOSERPLAYERS)
{
// Double gain in Battle
player->draftpower += add;
@ -3031,7 +3031,7 @@ fixed_t K_GetKartSpeedFromStat(UINT8 kartspeed, boolean karmabomb)
fixed_t K_GetKartSpeed(const player_t *player, boolean doboostpower, boolean dorubberband)
{
boolean karmabomb = ((gametyperules & GTR_BUMPERS) && player->bumper <= 0);
boolean karmabomb = ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0);
fixed_t finalspeed;
if (doboostpower && player->forcedtopspeed > 0)
@ -3077,7 +3077,7 @@ fixed_t K_GetKartAccel(const player_t *player)
fixed_t k_accel = 32; // 36;
UINT8 kartspeed = player->kartspeed;
if ((gametyperules & GTR_BUMPERS) && player->bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0)
kartspeed = 1;
k_accel += 4 * (9 - kartspeed); // 32 - 64
@ -3462,7 +3462,7 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN
// +3 points for hitting a wanted player
points = 3;
}
else if (gametyperules & GTR_BUMPERS)
else if (gametypes[gametype]->rules & GTR_BUMPERS)
{
if ((victim->bumper > 0) && (victim->bumper <= bumpersRemoved))
{
@ -3472,7 +3472,7 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN
}
}
if (gametyperules & GTR_POINTS)
if (gametypes[gametype]->rules & GTR_POINTS)
{
P_AddPlayerScore(player, points);
K_SpawnBattlePoints(player, victim, points);
@ -3651,7 +3651,7 @@ boolean K_IsPlayerDamaged(const player_t *player)
void K_HandleBumperChanges(player_t *player, UINT8 prevBumpers)
{
if (!(gametyperules & GTR_BUMPERS))
if (!(gametypes[gametype]->rules & GTR_BUMPERS))
{
// Bumpers aren't being used
return;
@ -3694,7 +3694,7 @@ void K_DestroyBumpers(player_t *player, UINT8 amount)
{
UINT8 oldBumpers = player->bumper;
if (!(gametyperules & GTR_BUMPERS))
if (!(gametypes[gametype]->rules & GTR_BUMPERS))
{
return;
}
@ -3717,7 +3717,7 @@ void K_TakeBumpersFromPlayer(player_t *player, player_t *victim, UINT8 amount)
UINT8 tookBumpers = 0;
if (!(gametyperules & GTR_BUMPERS))
if (!(gametypes[gametype]->rules & GTR_BUMPERS))
{
return;
}
@ -4319,7 +4319,7 @@ void K_SpawnBoostTrail(player_t *player)
if (!P_IsObjectOnGround(player->mo)
|| player->hyudorotimer != 0
|| ((gametyperules & GTR_BUMPERS) && player->bumper <= 0 && player->karmadelay))
|| ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0 && player->karmadelay))
return;
if (player->mo->eflags & MFE_VERTICALFLIP)
@ -6215,7 +6215,7 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
thisang = InvAngle(thisang);
// Jawz only go after the person directly ahead of you in race... sort of literally now!
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
// Don't go for people who are behind you
if (thisang > ANGLE_67h)
@ -6465,7 +6465,7 @@ void K_KartPlayerHUDUpdate(player_t *player)
if (player->karthud[khud_taunthorns])
player->karthud[khud_taunthorns]--;
if (gametyperules & GTR_RINGS)
if (gametypes[gametype]->rules & GTR_RINGS)
{
if ((K_RingsActive() == true))
{
@ -6484,7 +6484,7 @@ void K_KartPlayerHUDUpdate(player_t *player)
else
player->karthud[khud_finish] = 0;
if ((gametyperules & GTR_BUMPERS) && (player->exiting || player->karmadelay))
if ((gametypes[gametype]->rules & GTR_BUMPERS) && (player->exiting || player->karmadelay))
{
if (player->exiting)
{
@ -6746,7 +6746,7 @@ static void K_RaceStart(player_t *player)
UINT8 K_RaceLapCount(INT16 mapNum)
{
if (!(gametyperules & GTR_CIRCUIT))
if (!(gametypes[gametype]->rules & GTR_CIRCUIT))
{
// Not in Race mode
return 0;
@ -7373,7 +7373,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->rings = player->ringmin;
}
if (comeback == false || !(gametyperules & GTR_KARMA) || (player->pflags & PF_ELIMINATED))
if (comeback == false || !(gametypes[gametype]->rules & GTR_KARMA) || (player->pflags & PF_ELIMINATED))
{
player->karmadelay = comebacktime;
}
@ -7485,7 +7485,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (!playeringame[i] || players[i].spectator)
continue;
if (!(gametyperules & GTR_BUMPERS) || players[i].bumper)
if (!(gametypes[gametype]->rules & GTR_BUMPERS) || players[i].bumper)
pingame++;
if (pingame > 1) // We only want to see if one player is playing.
@ -7709,7 +7709,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->eggmanexplode)
{
if (player->spectator || ((gametyperules & GTR_BUMPERS) && !player->bumper))
if (player->spectator || ((gametypes[gametype]->rules & GTR_BUMPERS) && !player->bumper))
player->eggmanexplode = 0;
else
{
@ -9260,7 +9260,7 @@ INT16 K_GetKartTurnValue(const player_t *player, INT16 turnvalue)
INT32 K_GetKartDriftSparkValue(const player_t *player)
{
UINT8 kartspeed = ((gametyperules & GTR_BUMPERS) && player->bumper <= 0)
UINT8 kartspeed = ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0)
? 1
: player->kartspeed;
return (26*4 + kartspeed*2 + (9 - player->kartweight))*8;
@ -10081,7 +10081,7 @@ static UINT32 K_UpdateDistanceFromCluster(player_t* player)
if (!playeringame[i] || players[i].spectator)
continue;
if (!(gametyperules & GTR_BUMPERS) || players[i].bumper)
if (!(gametypes[gametype]->rules & GTR_BUMPERS) || players[i].bumper)
pingame++;
}
@ -10090,7 +10090,7 @@ static UINT32 K_UpdateDistanceFromCluster(player_t* player)
if (!playeringame[i] || players[i].spectator)
continue;
if ((players[i].mo) && (gametyperules & GTR_CIRCUIT))
if ((players[i].mo) && (gametypes[gametype]->rules & GTR_CIRCUIT))
{
if (players[i].position == 1 && first == -1)
first = i;
@ -10129,7 +10129,7 @@ static UINT32 K_UpdateDistanceFromCluster(player_t* player)
if (!playeringame[i] || players[i].spectator)
continue;
if ((players[i].mo) && (gametyperules & GTR_CIRCUIT))
if ((players[i].mo) && (gametypes[gametype]->rules & GTR_CIRCUIT))
{
if (players[i].position == (pingame - 1) && second == -1)
{
@ -10270,7 +10270,7 @@ void K_KartUpdatePosition(player_t *player)
if (!playeringame[i] || players[i].spectator || !players[i].mo)
continue;
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
if (player->exiting) // End of match standings
{
@ -10336,7 +10336,7 @@ void K_KartLegacyUpdatePosition(player_t *player)
if (!playeringame[i] || players[i].spectator || !players[i].mo)
continue;
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
if ((((players[i].starpostnum) + (numstarposts + 1) * players[i].laps) >
((player->starpostnum) + (numstarposts + 1) * player->laps)))
@ -10830,7 +10830,7 @@ static void K_AdjustPlayerFriction(player_t *player)
player->mo->friction -= 2048;
// Karma ice physics
if ((gametyperules & GTR_BUMPERS) && player->bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0)
{
player->mo->friction += 1228;
@ -11066,9 +11066,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
if ((buttons & BT_ATTACK) && (player->itemflags & IF_HOLDREADY))
{
SINT8 incr = (gametyperules & GTR_CLOSERPLAYERS) ? 3 : 2;
SINT8 metincr = (gametyperules & GTR_CLOSERPLAYERS) ? 4 : 3;
SINT8 comincr = (gametyperules & GTR_CLOSERPLAYERS) ? 10 : 4;
SINT8 incr = (gametypes[gametype]->rules & GTR_CLOSERPLAYERS) ? 3 : 2;
SINT8 metincr = (gametypes[gametype]->rules & GTR_CLOSERPLAYERS) ? 4 : 3;
SINT8 comincr = (gametypes[gametype]->rules & GTR_CLOSERPLAYERS) ? 10 : 4;
// uses fuel faster, but raises temperature faster
if (cv_kartflame_fastfuel.value && (!player->flameburnstop))
@ -11225,14 +11225,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->mo->renderflags &= ~RF_DONTDRAW;
}
if ((gametyperules & GTR_BUMPERS) && player->bumper <= 0) // dead in match? you da bomb
if ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0) // dead in match? you da bomb
{
K_DropItems(player); //K_StripItems(player);
K_StripOther(player);
player->mo->renderflags |= RF_GHOSTLY;
player->flashing = player->karmadelay;
}
else if ((player->bumper > 0) || ((gametyperules & GTR_CIRCUIT) && !(gametyperules & GTR_BUMPERS)))
else if ((player->bumper > 0) || ((gametypes[gametype]->rules & GTR_CIRCUIT) && !(gametypes[gametype]->rules & GTR_BUMPERS)))
{
player->mo->renderflags &= ~(RF_TRANSMASK|RF_BRIGHTMASK);
}
@ -11254,7 +11254,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
S_StartSound(player->mo, sfx_s224);
}
if (!(gametyperules & GTR_NOCOUNTDOWN))
if (!(gametypes[gametype]->rules & GTR_NOCOUNTDOWN))
K_RaceStart(player);
if (onground == false)
@ -11360,7 +11360,7 @@ void K_CheckSpectateStatus(boolean considermapreset)
return;
// DON'T allow if the race is at 2 laps
if ((gametyperules & GTR_CIRCUIT) && players[i].laps >= 2)
if ((gametypes[gametype]->rules & GTR_CIRCUIT) && players[i].laps >= 2)
return;
continue;
@ -11505,7 +11505,7 @@ boolean K_IsSPBInGame(void)
boolean K_RingsActive(void)
{
if (!(gametyperules & GTR_RINGS))
if (!(gametypes[gametype]->rules & GTR_RINGS))
{
// No Rings in this gametype.
return false;

View file

@ -113,7 +113,7 @@ INT16 K_PowerLevelPlacementScore(player_t *player)
return 0;
}
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
return MAXPLAYERS - player->position;
}
@ -136,9 +136,9 @@ INT16 K_CalculatePowerLevelAvg(void)
return 0; // No average.
}
if ((gametyperules & GTR_CIRCUIT))
if ((gametypes[gametype]->rules & GTR_CIRCUIT))
t = PWRLV_RACE;
else if ((gametyperules & GTR_BUMPERS))
else if ((gametypes[gametype]->rules & GTR_BUMPERS))
t = PWRLV_BATTLE;
if (t == PWRLV_DISABLED)

View file

@ -968,7 +968,7 @@ static void K_SpawnFootstepParticle(mobj_t *mo, t_footstep_t *fs, tic_t timer)
if (mo->player != NULL)
{
boolean karmabomb = ((gametyperules & GTR_BUMPERS) && mo->player->bumper <= 0);
boolean karmabomb = ((gametypes[gametype]->rules & GTR_BUMPERS) && mo->player->bumper <= 0);
tireAngle = (mo->player->drawangle + ANGLE_180);
speedValue = K_GetKartSpeedFromStat(mo->player->kartspeed, karmabomb);
}

View file

@ -296,7 +296,7 @@ int LUA_PushGlobals(lua_State *L, const char *word)
lua_pushinteger(L, gametype);
return 1;
} else if (fastcmp(word,"gametyperules")) {
lua_pushinteger(L, gametyperules);
lua_pushinteger(L, gametypes[gametype]->rules);
return 1;
} else if (fastcmp(word,"leveltime")) {
lua_pushinteger(L, leveltime);

View file

@ -5597,7 +5597,7 @@ static void M_RetryResponse(INT32 ch)
INT32 MR_Retry(INT32 choice)
{
(void)choice;
M_StartMessage(va("Start this %s over?\n\n(Press 'Y' to confirm)\n", (gametyperules & GTR_CIRCUIT) ? "race" : "battle"),M_RetryResponse,MM_YESNO);
M_StartMessage(va("Start this %s over?\n\n(Press 'Y' to confirm)\n", (gametypes[gametype]->rules & GTR_CIRCUIT) ? "race" : "battle"),M_RetryResponse,MM_YESNO);
return true;
}

View file

@ -3336,7 +3336,7 @@ void A_AttractChase(void *thing)
if (
actor->tracer->player && actor->tracer->health
&& ((gametyperules & GTR_BUMPERS)
&& ((gametypes[gametype]->rules & GTR_BUMPERS)
|| (actor->tracer->player->itemtype == KITEM_THUNDERSHIELD
&& RINGTOTAL(actor->tracer->player) < actor->tracer->player->ringmax
&& !(actor->tracer->player->pflags & PF_RINGLOCK)))
@ -4830,7 +4830,7 @@ void A_OldRingExplode(void *thing)
if (changecolor)
{
if (!(gametyperules & GTR_TEAMS))
if (!(gametypes[gametype]->rules & GTR_TEAMS))
mo->color = actor->target->color; //copy color
else if (actor->target->player->ctfteam == 2)
mo->color = skincolor_bluering;
@ -4846,7 +4846,7 @@ void A_OldRingExplode(void *thing)
if (changecolor)
{
if (!(gametyperules & GTR_TEAMS))
if (!(gametypes[gametype]->rules & GTR_TEAMS))
mo->color = actor->target->color; //copy color
else if (actor->target->player->ctfteam == 2)
mo->color = skincolor_bluering;
@ -4861,7 +4861,7 @@ void A_OldRingExplode(void *thing)
if (changecolor)
{
if (!(gametyperules & GTR_TEAMS))
if (!(gametypes[gametype]->rules & GTR_TEAMS))
mo->color = actor->target->color; //copy color
else if (actor->target->player->ctfteam == 2)
mo->color = skincolor_bluering;
@ -4888,7 +4888,7 @@ void A_MixUp(void *thing)
return;
// The random factor is okay for other game modes, but in these, it is cripplingly unfair.
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
S_StartSound(actor, sfx_lose);
return;
@ -10835,7 +10835,7 @@ void A_ItemPop(void *thing)
//if (actor->info->deathsound)
//S_StartSound(remains, actor->info->deathsound);
if (!((gametyperules & GTR_BUMPERS) && actor->target->player->bumper <= 0) && !itembreaker)
if (!((gametypes[gametype]->rules & GTR_BUMPERS) && actor->target->player->bumper <= 0) && !itembreaker)
{
K_StartRoulette(actor->target->player, KROULETTETYPE_NORMAL);
}
@ -10853,7 +10853,7 @@ void A_ItemPop(void *thing)
remains->flags2 &= ~MF2_AMBUSH;
// Here at mapload in battle?
if (gametyperules & GTR_BUMPERS && actor->threshold != 69)
if (gametypes[gametype]->rules & GTR_BUMPERS && actor->threshold != 69)
numgotboxes++;
P_RemoveMobj(actor);
@ -10987,7 +10987,7 @@ void A_SPBChase(void *thing)
if (players[i].respawn)
continue;*/ // respawning
if ((gametyperules & GTR_WANTED) && (gametyperules & GTR_WANTEDSPB))
if ((gametypes[gametype]->rules & GTR_WANTED) && (gametypes[gametype]->rules & GTR_WANTEDSPB))
{
if (K_IsPlayerMostWanted(&players[i]))
{
@ -11048,7 +11048,7 @@ void A_SPBChase(void *thing)
else if (actor->extravalue2-- <= 0)
actor->extravalue1 = 0; // back to SEEKING
if ((gametyperules & GTR_WANTED) && (gametyperules & GTR_WANTEDSPB))
if ((gametypes[gametype]->rules & GTR_WANTED) && (gametypes[gametype]->rules & GTR_WANTEDSPB))
{
spbplace = (actor->tracer->player - players);
}
@ -11177,7 +11177,7 @@ void A_SPBChase(void *thing)
&& !players[actor->lastlook].spectator
&& !players[actor->lastlook].exiting)
{
if ((gametyperules & GTR_WANTED) && (gametyperules & GTR_WANTEDSPB))
if ((gametypes[gametype]->rules & GTR_WANTED) && (gametypes[gametype]->rules & GTR_WANTEDSPB))
{
spbplace = actor->lastlook;
}
@ -11302,7 +11302,7 @@ static inline BlockItReturn_t PIT_SSMineSearch(mobj_t *thing)
return BMIT_CONTINUE;
if (thing->player && (thing->player->hyudorotimer
|| ((gametyperules & GTR_BUMPERS) && thing->player && thing->player->bumper <= 0 && thing->player->karmadelay)))
|| ((gametypes[gametype]->rules & GTR_BUMPERS) && thing->player && thing->player->bumper <= 0 && thing->player->karmadelay)))
return BMIT_CONTINUE;
// see if it went over / under
@ -11368,7 +11368,7 @@ static inline BlockItReturn_t PIT_MineExplode(mobj_t *thing)
if (netgame && thing->player && thing->player->spectator)
return BMIT_CONTINUE;
if ((gametyperules & GTR_BUMPERS) && grenade->target && grenade->target->player && grenade->target->player->bumper <= 0 && thing == grenade->target)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && grenade->target && grenade->target->player && grenade->target->player->bumper <= 0 && thing == grenade->target)
return BMIT_CONTINUE;
// see if it went over / under

View file

@ -68,7 +68,7 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
if (player->exiting || mapreset || (player->pflags & PF_ELIMINATED))
return false;
if ((gametyperules & GTR_BUMPERS) // No bumpers in Match
if ((gametypes[gametype]->rules & GTR_BUMPERS) // No bumpers in Match
&& !weapon
&& player->bumper <= 0)
return false;
@ -296,7 +296,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (!P_CanPickupItem(player, PICKUPITEM_FLOATING) || (player->itemamount && player->itemtype != special->threshold))
return;
if ((gametyperules & GTR_BUMPERS) && player->bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0)
return;
player->itemtype = special->threshold;
@ -326,7 +326,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (!itembreaker && !P_CanPickupItem(player, PICKUPITEM_ITEM))
return;
if ((gametyperules & GTR_BUMPERS) && player->bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0)
{
if (player->karmamode || player->karmadelay)
return;
@ -338,7 +338,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_KillMobj(special, toucher, toucher, DMG_NORMAL);
break;
case MT_ITEMCAPSULE:
if ((gametyperules & GTR_BUMPERS) && player->bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0)
return;
if (special->scale < special->extravalue1) // don't break it while it's respawning
@ -552,7 +552,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
S_StartSound(special, sfx_s1a2);
return;
case MT_CDUFO: // SRB2kart
if (special->fuse || !P_CanPickupItem(player, PICKUPITEM_ITEM) || ((gametyperules & GTR_BUMPERS) && player->bumper <= 0))
if (special->fuse || !P_CanPickupItem(player, PICKUPITEM_ITEM) || ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0))
return;
K_StartRoulette(player, KROULETTETYPE_KARMA);
@ -1057,7 +1057,7 @@ void P_CheckTimeLimit(void)
}
#ifdef TESTOVERTIMEINFREEPLAY
if (timelimitintics > 0 && (gametyperules & GTR_TIMELIMIT) && startedInFreePlay)
if (timelimitintics > 0 && (gametypes[gametype]->rules & GTR_TIMELIMIT) && startedInFreePlay)
{
goto overtimesound;
}
@ -1070,7 +1070,7 @@ void P_CheckTimeLimit(void)
S_StartSound(NULL, sfx_strpst);
// Normal Match
if (!(gametyperules & GTR_TEAMS))
if (!(gametypes[gametype]->rules & GTR_TEAMS))
{
//Store the nodes of participating players in an array.
for (i = 0; i < MAXPLAYERS; i++)
@ -1144,7 +1144,7 @@ void P_CheckPointLimit(void)
if (!cv_pointlimit.value)
return;
if (!(gametyperules & GTR_POINTLIMIT))
if (!(gametypes[gametype]->rules & GTR_POINTLIMIT))
return;
if (itembreaker)
@ -1501,7 +1501,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
}
}
if (gametyperules & GTR_BUMPERS)
if (gametypes[gametype]->rules & GTR_BUMPERS)
K_CheckBumpers();
K_ResetPogoSpring(target->player);
@ -2017,7 +2017,7 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source,
if (type == DMG_TIMEOVER)
{
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
mobj_t *boom = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_FZEROBOOM);
boom->scale = player->mo->scale;
@ -2192,7 +2192,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// If not, then spawn the instashield effect instead.
if (!force)
{
if (gametyperules & GTR_BUMPERS)
if (gametypes[gametype]->rules & GTR_BUMPERS)
{
if ((player->bumper <= 0 && player->karmadelay) || (player->karmamode == 1))
{
@ -2251,7 +2251,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// We successfully damaged them! Give 'em some bumpers!
if (source && source != player->mo && source->player)
{
if (gametyperules & GTR_BUMPERS)
if (gametypes[gametype]->rules & GTR_BUMPERS)
{
K_BattleAwardHit(source->player, player, inflictor, 1);
@ -2303,12 +2303,12 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
player->glanceDir = 0;
player->pflags &= ~PF_GAINAX;
if (gametyperules & GTR_BUMPERS)
if (gametypes[gametype]->rules & GTR_BUMPERS)
{
if (player->bumper <= 0)
{
player->karmadelay = comebacktime;
if ((gametyperules & GTR_KARMA) && player->karmamode == 2 )
if ((gametypes[gametype]->rules & GTR_KARMA) && player->karmamode == 2 )
{
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);

View file

@ -1338,7 +1338,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
return BMIT_CONTINUE;
}
if ((gametyperules & GTR_BUMPERS)
if ((gametypes[gametype]->rules & GTR_BUMPERS)
&& ((thing->player->bumper && !g_tm.thing->player->bumper)
|| (g_tm.thing->player->bumper && !thing->player->bumper)))
{

View file

@ -4358,7 +4358,7 @@ boolean P_SupermanLook4Players(mobj_t *actor)
if (players[c].mo->health <= 0)
continue; // dead
if ((gametyperules & GTR_BUMPERS) && players[c].bumper <= 0)
if ((gametypes[gametype]->rules & GTR_BUMPERS) && players[c].bumper <= 0)
continue; // other dead
playersinthegame[stop] = &players[c];
@ -7561,7 +7561,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
mobj->color = mobj->target->color;
K_MatchGenericExtraFlags(mobj, mobj->target);
if ((!(gametyperules & GTR_ITEMARROWS) || (gametyperules & GTR_BUMPERS && mobj->target->player->bumper <= 0))
if ((!(gametypes[gametype]->rules & GTR_ITEMARROWS) || (gametypes[gametype]->rules & GTR_BUMPERS && mobj->target->player->bumper <= 0))
#if 1 // Set to 0 to test without needing to host
|| (P_IsDisplayPlayer(mobj->target->player))
#endif
@ -8580,7 +8580,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
else if (gamespeed == KARTSPEED_EXPERT)
distbarrier = FixedMul(distbarrier, FRACUNIT+FRACUNIT/2);
if ((gametyperules & GTR_CIRCUIT) && mobj->tracer)
if ((gametypes[gametype]->rules & GTR_CIRCUIT) && mobj->tracer)
{
distaway = P_AproxDistance(mobj->tracer->x - mobj->x, mobj->tracer->y - mobj->y);
if (distaway < distbarrier)
@ -9431,7 +9431,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
statenum_t state = (mobj->state-states);
if (!mobj->target || !mobj->target->health || !mobj->target->player || mobj->target->player->spectator
|| mobj->target->player->bumper || !(gametyperules & GTR_KARMA))
|| mobj->target->player->bumper || !(gametypes[gametype]->rules & GTR_KARMA))
{
P_RemoveMobj(mobj);
return false;
@ -10392,7 +10392,7 @@ static boolean P_FuseThink(mobj_t *mobj)
{
;
}
else if (gametyperules & GTR_BATTLEBOXES)
else if (gametypes[gametype]->rules & GTR_BATTLEBOXES)
{
if (mobj->threshold != 69)
break;
@ -12514,7 +12514,7 @@ void P_SpawnPlayer(INT32 playernum)
p->grieftime = 0;
p->spinoutrot = 0;
if (gametyperules & GTR_ITEMARROWS)
if (gametypes[gametype]->rules & GTR_ITEMARROWS)
{
mobj_t *overheadarrow = P_SpawnMobj(mobj->x, mobj->y, mobj->z + mobj->height + 16*FRACUNIT, MT_PLAYERARROW);
P_SetTarget(&overheadarrow->target, mobj);
@ -12522,7 +12522,7 @@ void P_SpawnPlayer(INT32 playernum)
P_SetScale(overheadarrow, mobj->destscale);
}
if (gametyperules & GTR_BUMPERS)
if (gametypes[gametype]->rules & GTR_BUMPERS)
{
if (p->spectator)
{
@ -12538,7 +12538,7 @@ void P_SpawnPlayer(INT32 playernum)
K_SpawnPlayerBattleBumpers(p);
}
else if (p->bumper <= 0 && (gametyperules & GTR_KARMA))
else if (p->bumper <= 0 && (gametypes[gametype]->rules & GTR_KARMA))
{
mobj_t *karmahitbox = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_KARMAHITBOX); // Player hitbox is too small!!
P_SetTarget(&karmahitbox->target, mobj);
@ -12968,7 +12968,7 @@ static mobjtype_t P_GetMobjtypeSubstitute(mapthing_t *mthing, mobjtype_t i)
{
(void)mthing;
if ((i == MT_RANDOMITEM) && (gametyperules & (GTR_PAPERITEMS|GTR_CIRCUIT)) == (GTR_PAPERITEMS|GTR_CIRCUIT) && !bossinfo.boss)
if ((i == MT_RANDOMITEM) && (gametypes[gametype]->rules & (GTR_PAPERITEMS|GTR_CIRCUIT)) == (GTR_PAPERITEMS|GTR_CIRCUIT) && !bossinfo.boss)
return MT_PAPERITEMSPOT;
return i;

View file

@ -8286,7 +8286,7 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
// SRB2Kart: map load variables
if (grandprixinfo.gp == true)
{
if ((gametyperules & GTR_BATTLESPEED))
if ((gametypes[gametype]->rules & GTR_BATTLESPEED))
{
gamespeed = KARTSPEED_NORMAL;
}
@ -8307,7 +8307,7 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
else if (modeattacking)
{
// Just play it safe and set everything
if ((gametyperules & GTR_BATTLESPEED))
if ((gametypes[gametype]->rules & GTR_BATTLESPEED))
gamespeed = KARTSPEED_NORMAL;
else
gamespeed = KARTSPEED_HARD;
@ -8316,7 +8316,7 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
}
else
{
if (gametyperules & GTR_BATTLESPEED)
if (gametypes[gametype]->rules & GTR_BATTLESPEED)
{
if (cv_kartbattlespeed.value == KARTSPEED_AUTO)
gamespeed = ((speedscramble == -1) ? KARTSPEED_EASY : (UINT8)speedscramble);
@ -8488,7 +8488,7 @@ static void P_SetupCamera(UINT8 pnum, camera_t *cam)
{
mapthing_t *thing;
if (gametyperules & GTR_BATTLESTARTS)
if (gametypes[gametype]->rules & GTR_BATTLESTARTS)
thing = deathmatchstarts[0];
else
thing = playerstarts[0];
@ -8533,7 +8533,7 @@ static void P_InitPlayers(void)
players[i].mo = NULL;
if (!(gametyperules & GTR_CIRCUIT))
if (!(gametypes[gametype]->rules & GTR_CIRCUIT))
{
G_DoReborn(i);
}
@ -9048,7 +9048,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
K_ClearWaypoints();
// Load the ccheckpoints and waypoints please!
if (gametyperules & GTR_CIRCUIT && gamestate != GS_TITLESCREEN)
if (gametypes[gametype]->rules & GTR_CIRCUIT && gamestate != GS_TITLESCREEN)
{
if ((K_SetupWaypointList() == false))
{

View file

@ -4451,7 +4451,7 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
return false;
}
if ((gametyperules & GTR_CIRCUIT) && (mo->player->exiting == 0) && !(mo->player->pflags & PF_HITFINISHLINE))
if ((gametypes[gametype]->rules & GTR_CIRCUIT) && (mo->player->exiting == 0) && !(mo->player->pflags & PF_HITFINISHLINE))
{
// megablock cope 1: single-use finish lines
if (args[0] & TMCFF_SINGLEUSE && mo->player->laps > 0)
@ -5257,7 +5257,7 @@ static void P_ProcessExitSector(player_t *player, mtag_t sectag)
INT32 lineindex;
#if 0
if (!(gametyperules & GTR_ALLOWEXIT))
if (!(gametypes[gametype]->rules & GTR_ALLOWEXIT))
return;
#endif
@ -5416,7 +5416,7 @@ static void P_EvaluateSpecialFlags(player_t *player, sector_t *sector, sector_t
P_ProcessZoomTube(player, sectag, true);
if (sector->specialflags & SSF_FINISHLINE)
{
if (K_UsingLegacyCheckpoints() && (gametyperules & GTR_CIRCUIT) && (player->exiting == 0) && !(player->pflags & PF_HITFINISHLINE))
if (K_UsingLegacyCheckpoints() && (gametypes[gametype]->rules & GTR_CIRCUIT) && (player->exiting == 0) && !(player->pflags & PF_HITFINISHLINE))
{
K_HandleLapIncrement(player);
player->pflags |= PF_HITFINISHLINE;
@ -5570,7 +5570,7 @@ static void P_EvaluateOldSectorSpecial(player_t *player, sector_t *sector, secto
{
if (!(sector->specialflags & SSF_FINISHLINE))
{
if (K_UsingLegacyCheckpoints() && (gametyperules & GTR_CIRCUIT) && (player->exiting == 0) && !(player->pflags & PF_HITFINISHLINE))
if (K_UsingLegacyCheckpoints() && (gametypes[gametype]->rules & GTR_CIRCUIT) && (player->exiting == 0) && !(player->pflags & PF_HITFINISHLINE))
{
K_HandleLapIncrement(player);
player->pflags |= PF_HITFINISHLINE;
@ -7022,15 +7022,15 @@ static boolean P_CheckGametypeRules(INT32 checktype, UINT32 target)
{
case TMF_HASALL:
default:
return (gametyperules & target) == target;
return (gametypes[gametype]->rules & target) == target;
case TMF_HASANY:
return !!(gametyperules & target);
return !!(gametypes[gametype]->rules & target);
case TMF_HASEXACTLY:
return gametyperules == target;
return gametypes[gametype]->rules == target;
case TMF_DOESNTHAVEALL:
return (gametyperules & target) != target;
return (gametypes[gametype]->rules & target) != target;
case TMF_DOESNTHAVEANY:
return !(gametyperules & target);
return !(gametypes[gametype]->rules & target);
}
}
@ -7109,7 +7109,7 @@ void P_SpawnSpecials(boolean fromnetsave)
switch(GETSECSPECIAL(sector->special, 4))
{
case 10: // Circuit finish line (Unused)
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
circuitmap = true;
break;
}
@ -7823,7 +7823,7 @@ void P_SpawnSpecials(boolean fromnetsave)
// Linedef executor triggers for CTF teams.
case 309:
if (!(gametyperules & GTR_TEAMS))
if (!(gametypes[gametype]->rules & GTR_TEAMS))
{
lines[i].special = 0;
break;
@ -8065,7 +8065,7 @@ void P_SpawnSpecials(boolean fromnetsave)
// SRB2Kart
case 2001: // Finish Line
if ((gametyperules & GTR_CIRCUIT))
if ((gametypes[gametype]->rules & GTR_CIRCUIT))
circuitmap = true;
break;

View file

@ -494,7 +494,7 @@ static void P_RunThinkers(void)
ps_thlist_times[i] = I_GetPreciseTime() - ps_thlist_times[i];
}
if (gametyperules & GTR_PAPERITEMS)
if (gametypes[gametype]->rules & GTR_PAPERITEMS)
K_RunPaperItemSpawners();
ps_acs_time = I_GetPreciseTime();
@ -839,7 +839,7 @@ void P_Ticker(boolean run)
{
if (!(titlemapinaction == TITLEMAP_RUNNING))
{
if (!(gametyperules & GTR_NOCOUNTDOWN))
if (!(gametypes[gametype]->rules & GTR_NOCOUNTDOWN))
{
if (leveltime == starttime-(3*TICRATE))
{
@ -855,9 +855,9 @@ void P_Ticker(boolean run)
}
}
// Change timing of start music based on gametyperules
// Change timing of start music based on gametypes[gametype]->rules
{
tic_t startingtime = (gametyperules & GTR_NOCOUNTDOWN) ? introtime : starttime;
tic_t startingtime = (gametypes[gametype]->rules & GTR_NOCOUNTDOWN) ? introtime : starttime;
if (leveltime < startingtime) // SRB2Kart
S_ChangeMusicInternal(((grandprixinfo.roundnum > 0) ? "gpstrt" : (encoremode ? "estart" : "kstart")), false); // yes this will be spammed otherwise encore and some stuff WILL overwrite it
else if (leveltime == startingtime) // The GO! sound stops the level start ambience
@ -920,7 +920,7 @@ void P_Ticker(boolean run)
K_TickSpecialStage();
if (gametyperules & GTR_WANTED)
if (gametypes[gametype]->rules & GTR_WANTED)
{
if (wantedcalcdelay && --wantedcalcdelay <= 0)
K_CalculateBattleWanted();

View file

@ -418,7 +418,7 @@ UINT8 P_FindLowestLap(void)
INT32 i;
UINT8 lowest = UINT8_MAX;
if (!(gametyperules & GTR_CIRCUIT))
if (!(gametypes[gametype]->rules & GTR_CIRCUIT))
return 0;
for (i = 0; i < MAXPLAYERS; i++)
@ -445,7 +445,7 @@ UINT8 P_FindHighestLap(void)
INT32 i;
UINT8 highest = 0;
if (!(gametyperules & GTR_CIRCUIT))
if (!(gametypes[gametype]->rules & GTR_CIRCUIT))
return 0;
for (i = 0; i < MAXPLAYERS; i++)
@ -540,7 +540,7 @@ void P_GivePlayerLives(player_t *player, INT32 numlives)
// Adds to the player's score
void P_AddPlayerScore(player_t *player, UINT32 amount)
{
if (!(gametyperules & GTR_POINTS))
if (!(gametypes[gametype]->rules & GTR_POINTS))
return;
if (player->exiting) // srb2kart
@ -762,7 +762,7 @@ boolean P_EndingMusic(player_t *player)
#undef getplayerpos
if ((gametyperules & GTR_CIRCUIT) && bestlocalpos == MAXPLAYERS+1)
if ((gametypes[gametype]->rules & GTR_CIRCUIT) && bestlocalpos == MAXPLAYERS+1)
sprintf(buffer, "k*fail"); // F-Zero death results theme
else
{
@ -776,9 +776,9 @@ boolean P_EndingMusic(player_t *player)
S_SpeedMusic(1.0f);
if ((gametyperules & GTR_CIRCUIT))
if ((gametypes[gametype]->rules & GTR_CIRCUIT))
buffer[1] = 'r';
else if ((gametyperules & GTR_BUMPERS))
else if ((gametypes[gametype]->rules & GTR_BUMPERS))
{
buffer[1] = 'b';
looping = false;
@ -889,7 +889,7 @@ void P_RestoreMusic(player_t *player)
#if 0
// Event - Final Lap
// Still works for GME, but disabled for consistency
if ((gametyperules & GTR_CIRCUIT) && player->laps >= numlaps)
if ((gametypes[gametype]->rules & GTR_CIRCUIT) && player->laps >= numlaps)
S_SpeedMusic(1.2f);
#endif
if (mapmusresume && cv_resume.value)
@ -1316,7 +1316,7 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
if (!player->spectator)
{
boolean losing;
if ((gametyperules & GTR_CIRCUIT)) // If in Race Mode, allow
if ((gametypes[gametype]->rules & GTR_CIRCUIT)) // If in Race Mode, allow
{
player->exiting = raceexittime+2;
K_UpdateAllPlayerPositions();
@ -1345,7 +1345,7 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
G_BeginLevelExit();
}
}
else if ((gametyperules & GTR_BUMPERS)) // Battle Mode exiting
else if ((gametypes[gametype]->rules & GTR_BUMPERS)) // Battle Mode exiting
{
player->exiting = battleexittime+1;
G_BeginLevelExit();
@ -2087,7 +2087,7 @@ boolean P_CanPlayerTurn(player_t *player, ticcmd_t *cmd)
return true;
}
if (((gametyperules & GTR_NOCOUNTDOWN) || (leveltime > starttime))
if (((gametypes[gametype]->rules & GTR_NOCOUNTDOWN) || (leveltime > starttime))
&& (cmd->buttons & BT_ACCELERATE)
&& (cmd->buttons & BT_BRAKE))
{
@ -2162,7 +2162,7 @@ static void P_UpdatePlayerAngle(player_t *player)
player->lturn_max[leveltime%MAXPREDICTTICS] = player->rturn_max[leveltime%MAXPREDICTTICS] = 0;
}
if ((gametyperules & GTR_NOCOUNTDOWN) || leveltime >= starttime)
if ((gametypes[gametype]->rules & GTR_NOCOUNTDOWN) || leveltime >= starttime)
{
// KART: Don't directly apply angleturn! It may have been either A) forged by a malicious client, or B) not be a smooth turn due to a player dropping frames.
// Instead, turn the player only up to the amount they're supposed to turn accounting for latency. Allow exactly 1 extra turn unit to try to keep old replays synced.
@ -4109,7 +4109,7 @@ void P_PlayerThink(player_t *player)
if (!mapreset)
{
if (gametyperules & GTR_CIRCUIT)
if (gametypes[gametype]->rules & GTR_CIRCUIT)
{
INT32 i;
@ -4153,7 +4153,7 @@ void P_PlayerThink(player_t *player)
// If it is set, start subtracting
// Don't allow it to go back to 0
if (player->exiting > 1 && (player->exiting < raceexittime+2 || !(gametyperules & GTR_CIRCUIT))) // SRB2kart - "&& player->exiting > 1"
if (player->exiting > 1 && (player->exiting < raceexittime+2 || !(gametypes[gametype]->rules & GTR_CIRCUIT))) // SRB2kart - "&& player->exiting > 1"
player->exiting--;
if (player->exiting && exitcountdown)
@ -4177,7 +4177,7 @@ void P_PlayerThink(player_t *player)
}
// SRB2kart 010217
if (!(gametyperules & GTR_NOCOUNTDOWN))
if (!(gametypes[gametype]->rules & GTR_NOCOUNTDOWN))
{
if (leveltime < starttime)
{
@ -4211,7 +4211,7 @@ void P_PlayerThink(player_t *player)
}
}
if (netgame && cv_antigrief.value != 0 && (gametyperules & GTR_CIRCUIT))
if (netgame && cv_antigrief.value != 0 && (gametypes[gametype]->rules & GTR_CIRCUIT))
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
@ -4479,7 +4479,7 @@ void P_PlayerThink(player_t *player)
|| player->growshrinktimer > 0 // Grow doesn't flash either.
|| (player->respawn) // Respawn timer (for drop dash effect)
|| (player->pflags & PF_NOCONTEST) // NO CONTEST explosion
|| ((gametyperules & GTR_BUMPERS) && player->bumper <= 0 && player->karmadelay)))
|| ((gametypes[gametype]->rules & GTR_BUMPERS) && player->bumper <= 0 && player->karmadelay)))
{
if (player->flashing > 0 && player->flashing < K_GetKartFlashing(player)
&& (leveltime & 1))