mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Remove Gametype Preference and Voting Rule Change cvars
* The consensus has moved against gametype changes in voting, so strip it out * Encorescramble already independently controls setting Encore, so don't keep the outdated randomisation method Done in this branch because it uses gametype constants directly, both in a cvar and function, and I want to get rid of as many of those as possible
This commit is contained in:
parent
3101cf25cd
commit
d95ac73f3b
7 changed files with 19 additions and 86 deletions
|
|
@ -899,9 +899,6 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
|||
UINT8 *p;
|
||||
size_t mirror_length;
|
||||
const char *httpurl = cv_httpsource.string;
|
||||
UINT8 prefgametype = (cv_kartgametypepreference.value == -1)
|
||||
? gametype
|
||||
: cv_kartgametypepreference.value;
|
||||
|
||||
netbuffer->packettype = PT_SERVERINFO;
|
||||
netbuffer->u.serverinfo._255 = 255;
|
||||
|
|
@ -933,7 +930,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
|
|||
else
|
||||
netbuffer->u.serverinfo.refusereason = 0;
|
||||
|
||||
strncpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[prefgametype],
|
||||
strncpy(netbuffer->u.serverinfo.gametypename, Gametype_Names[gametype],
|
||||
sizeof netbuffer->u.serverinfo.gametypename);
|
||||
netbuffer->u.serverinfo.modifiedgame = (UINT8)modifiedgame;
|
||||
netbuffer->u.serverinfo.cheatsenabled = CV_CheatsEnabled();
|
||||
|
|
|
|||
|
|
@ -399,10 +399,6 @@ consvar_t cv_kartbumpers = CVAR_INIT ("battlebumpers", "3", CV_NETVAR, kartbumpe
|
|||
consvar_t cv_kartfrantic = CVAR_INIT ("franticitems", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange);
|
||||
static CV_PossibleValue_t kartencore_cons_t[] = {{-1, "Auto"}, {0, "Off"}, {1, "On"}, {0, NULL}};
|
||||
consvar_t cv_kartencore = CVAR_INIT ("encore", "Auto", CV_NETVAR|CV_CALL|CV_NOINIT, kartencore_cons_t, KartEncore_OnChange);
|
||||
static CV_PossibleValue_t kartvoterulechanges_cons_t[] = {{0, "Never"}, {1, "Sometimes"}, {2, "Frequent"}, {3, "Always"}, {0, NULL}};
|
||||
consvar_t cv_kartvoterulechanges = CVAR_INIT ("voterulechanges", "Frequent", CV_NETVAR, kartvoterulechanges_cons_t, NULL);
|
||||
static CV_PossibleValue_t kartgametypepreference_cons_t[] = {{-1, "None"}, {GT_RACE, "Race"}, {GT_BATTLE, "Battle"}, {0, NULL}};
|
||||
consvar_t cv_kartgametypepreference = CVAR_INIT ("gametypepreference", "None", CV_NETVAR, kartgametypepreference_cons_t, NULL);
|
||||
static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Percentage"}, {2, "Kilometers"}, {3, "Miles"}, {4, "Fracunits"}, {0, NULL}};
|
||||
consvar_t cv_kartspeedometer = CVAR_INIT ("speedometer", "Percentage", CV_SAVE, kartspeedometer_cons_t, NULL); // use tics in display
|
||||
static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}};
|
||||
|
|
@ -2596,14 +2592,13 @@ void D_SetupVote(void)
|
|||
UINT8 buf[5*2]; // four UINT16 maps (at twice the width of a UINT8), and two gametypes
|
||||
UINT8 *p = buf;
|
||||
INT32 i;
|
||||
UINT8 gt = (cv_kartgametypepreference.value == -1) ? gametype : cv_kartgametypepreference.value;
|
||||
UINT8 secondgt = G_SometimesGetDifferentGametype(gt);
|
||||
UINT8 secondgt = G_SometimesGetDifferentGametype();
|
||||
INT16 votebuffer[4] = {-1,-1,-1,0};
|
||||
|
||||
if ((cv_kartencore.value == 1) && (gametypedefaultrules[gt] & GTR_CIRCUIT))
|
||||
WRITEUINT8(p, (gt|VOTEMODIFIER_ENCORE));
|
||||
if ((cv_kartencore.value == 1) && (gametypedefaultrules[gametype] & GTR_CIRCUIT))
|
||||
WRITEUINT8(p, (gametype|VOTEMODIFIER_ENCORE));
|
||||
else
|
||||
WRITEUINT8(p, gt);
|
||||
WRITEUINT8(p, gametype);
|
||||
WRITEUINT8(p, secondgt);
|
||||
secondgt &= ~VOTEMODIFIER_ENCORE;
|
||||
|
||||
|
|
@ -2613,9 +2608,9 @@ void D_SetupVote(void)
|
|||
if (i == 2) // sometimes a different gametype
|
||||
m = G_RandMap(G_TOLFlag(secondgt), prevmap, ((secondgt != gametype) ? 2 : 0), 0, true, votebuffer);
|
||||
else if (i >= 3) // unknown-random and formerly force-unknown MAP HELL
|
||||
m = G_RandMap(G_TOLFlag(gt), prevmap, 0, (i-2), (i < 4), votebuffer);
|
||||
m = G_RandMap(G_TOLFlag(gametype), prevmap, 0, (i-2), (i < 4), votebuffer);
|
||||
else
|
||||
m = G_RandMap(G_TOLFlag(gt), prevmap, 0, 0, true, votebuffer);
|
||||
m = G_RandMap(G_TOLFlag(gametype), prevmap, 0, 0, true, votebuffer);
|
||||
if (i < 3)
|
||||
votebuffer[i] = m;
|
||||
WRITEUINT16(p, m);
|
||||
|
|
|
|||
|
|
@ -79,8 +79,6 @@ extern consvar_t cv_kartspeed;
|
|||
extern consvar_t cv_kartbumpers;
|
||||
extern consvar_t cv_kartfrantic;
|
||||
extern consvar_t cv_kartencore;
|
||||
extern consvar_t cv_kartvoterulechanges;
|
||||
extern consvar_t cv_kartgametypepreference;
|
||||
extern consvar_t cv_kartspeedometer;
|
||||
extern consvar_t cv_kartvoices;
|
||||
extern consvar_t cv_kartbot;
|
||||
|
|
|
|||
74
src/g_game.c
74
src/g_game.c
|
|
@ -318,9 +318,8 @@ typedef struct
|
|||
{
|
||||
INT16 *mapbuffer; // Pointer to zone memory
|
||||
INT32 lastnummapheaders; // Reset if nummapheaders != this
|
||||
UINT8 counttogametype; // Time to gametype change event
|
||||
} randmaps_t;
|
||||
static randmaps_t randmaps = {NULL, 0, 0};
|
||||
static randmaps_t randmaps = {NULL, 0};
|
||||
|
||||
static void G_ResetRandMapBuffer(void)
|
||||
{
|
||||
|
|
@ -330,7 +329,6 @@ static void G_ResetRandMapBuffer(void)
|
|||
randmaps.mapbuffer = Z_Malloc(randmaps.lastnummapheaders * sizeof(INT16), PU_STATIC, NULL);
|
||||
for (i = 0; i < randmaps.lastnummapheaders; i++)
|
||||
randmaps.mapbuffer[i] = -1;
|
||||
//intentionally not resetting randmaps.counttogametype here
|
||||
}
|
||||
|
||||
typedef struct joystickvector2_s
|
||||
|
|
@ -3294,80 +3292,30 @@ boolean G_GametypeHasSpectators(void)
|
|||
//
|
||||
// G_SometimesGetDifferentGametype
|
||||
//
|
||||
// Oh, yeah, and we sometimes flip encore mode on here too.
|
||||
// Because gametypes are no longer on the vote screen, all this does is sometimes flip encore mode.
|
||||
// However, it remains a seperate function for long-term possibility.
|
||||
//
|
||||
INT16 G_SometimesGetDifferentGametype(UINT8 prefgametype)
|
||||
INT16 G_SometimesGetDifferentGametype(void)
|
||||
{
|
||||
// Most of the gametype references in this condition are intentionally not prefgametype.
|
||||
// This is so a server CAN continue playing a gametype if they like the taste of it.
|
||||
// The encore check needs prefgametype so can't use G_RaceGametype...
|
||||
boolean encorepossible = ((M_SecretUnlocked(SECRET_ENCORE, false) || encorescramble == 1)
|
||||
&& ((gametyperules|gametypedefaultrules[prefgametype]) & GTR_CIRCUIT));
|
||||
&& ((gametyperules|gametypedefaultrules[gametype]) & GTR_CIRCUIT));
|
||||
UINT8 encoremodifier = 0;
|
||||
|
||||
// -- the below is only necessary if you want to use randmaps.mapbuffer here
|
||||
//if (randmaps.lastnummapheaders != nummapheaders)
|
||||
//G_ResetRandMapBuffer();
|
||||
|
||||
if (encorepossible)
|
||||
// FORCE to what was scrambled on intermission?
|
||||
if (encorepossible && encorescramble != -1)
|
||||
{
|
||||
if (encorescramble != -1)
|
||||
// FORCE to what was scrambled on intermission
|
||||
if ((encorescramble != 0) != (cv_kartencore.value == 1))
|
||||
{
|
||||
encorepossible = (boolean)encorescramble; // FORCE to what was scrambled on intermission
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (cv_kartvoterulechanges.value)
|
||||
{
|
||||
case 3: // always
|
||||
encorepossible = true;
|
||||
break;
|
||||
case 2: // frequent
|
||||
encorepossible = M_RandomChance(FRACUNIT>>1);
|
||||
break;
|
||||
case 1: // sometimes
|
||||
encorepossible = M_RandomChance(FRACUNIT>>2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (encorepossible != (cv_kartencore.value == 1))
|
||||
encoremodifier = VOTEMODIFIER_ENCORE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cv_kartvoterulechanges.value) // never
|
||||
return (gametype|encoremodifier);
|
||||
|
||||
if (randmaps.counttogametype > 0 && (cv_kartvoterulechanges.value != 3))
|
||||
{
|
||||
randmaps.counttogametype--;
|
||||
return (gametype|encoremodifier);
|
||||
}
|
||||
|
||||
switch (cv_kartvoterulechanges.value) // okay, we're having a gametype change! when's the next one, luv?
|
||||
{
|
||||
case 1: // sometimes
|
||||
randmaps.counttogametype = 5; // per "cup"
|
||||
break;
|
||||
default:
|
||||
// fallthrough - happens when clearing buffer, but needs a reasonable countdown if cvar is modified
|
||||
case 2: // frequent
|
||||
randmaps.counttogametype = 2; // ...every 1/2th-ish cup?
|
||||
break;
|
||||
}
|
||||
|
||||
// Only this response is prefgametype-based.
|
||||
// todo custom gametypes
|
||||
if (prefgametype == GT_BATTLE)
|
||||
{
|
||||
// Intentionally does not use encoremodifier!
|
||||
if (cv_kartencore.value == 1)
|
||||
return (GT_RACE|VOTEMODIFIER_ENCORE);
|
||||
return (GT_RACE);
|
||||
}
|
||||
// This might appear wrong HERE, but the game will display the Encore possibility on the second voting choice instead.
|
||||
return (GT_BATTLE|encoremodifier);
|
||||
return (gametype|encoremodifier);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ boolean G_GametypeUsesLives(void);
|
|||
boolean G_GametypeHasTeams(void);
|
||||
boolean G_GametypeHasSpectators(void);
|
||||
#define VOTEMODIFIER_ENCORE 0x80
|
||||
INT16 G_SometimesGetDifferentGametype(UINT8 prefgametype);
|
||||
INT16 G_SometimesGetDifferentGametype(void);
|
||||
UINT8 G_GetGametypeColor(INT16 gt);
|
||||
void G_ExitLevel(void);
|
||||
void G_NextLevel(void);
|
||||
|
|
|
|||
|
|
@ -310,8 +310,6 @@ void K_RegisterKartStuff(void)
|
|||
CV_RegisterVar(&cv_kartbumpers);
|
||||
CV_RegisterVar(&cv_kartfrantic);
|
||||
CV_RegisterVar(&cv_kartencore);
|
||||
CV_RegisterVar(&cv_kartvoterulechanges);
|
||||
CV_RegisterVar(&cv_kartgametypepreference);
|
||||
CV_RegisterVar(&cv_kartspeedometer);
|
||||
CV_RegisterVar(&cv_kartvoices);
|
||||
CV_RegisterVar(&cv_kartbot);
|
||||
|
|
|
|||
|
|
@ -1132,9 +1132,6 @@ menuitem_t OPTIONS_Server[] =
|
|||
{IT_STRING | IT_CVAR, "Vote Timer", "Set how long players have to vote.",
|
||||
NULL, {.cvar = &cv_votetime}, 0, 0},
|
||||
|
||||
{IT_STRING | IT_CVAR, "Vote Mode Change", "Set how often voting proposes a different gamemode.",
|
||||
NULL, {.cvar = &cv_kartvoterulechanges}, 0, 0},
|
||||
|
||||
|
||||
{IT_SPACE | IT_NOTHING, NULL, NULL,
|
||||
NULL, {NULL}, 0, 0},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue