mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Merge branch 'cheats-streamline' into 'master'
Streamline cheats See merge request KartKrew/Kart!697
This commit is contained in:
commit
5d8df43b10
21 changed files with 362 additions and 382 deletions
|
|
@ -77,6 +77,15 @@ CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}};
|
||||||
CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}};
|
CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}};
|
||||||
CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}};
|
CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}};
|
||||||
|
|
||||||
|
// Cheats
|
||||||
|
#ifdef DEVELOP
|
||||||
|
#define VALUE "On"
|
||||||
|
#else
|
||||||
|
#define VALUE "Off"
|
||||||
|
#endif
|
||||||
|
consvar_t cv_cheats = CVAR_INIT ("cheats", VALUE, CV_NETVAR|CV_CALL, CV_OnOff, CV_CheatsChanged);
|
||||||
|
#undef VALUE
|
||||||
|
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
CV_PossibleValue_t kartspeed_cons_t[] = {
|
CV_PossibleValue_t kartspeed_cons_t[] = {
|
||||||
{KARTSPEED_AUTO, "Auto"},
|
{KARTSPEED_AUTO, "Auto"},
|
||||||
|
|
@ -353,6 +362,9 @@ void COM_Init(void)
|
||||||
// allocate command buffer
|
// allocate command buffer
|
||||||
VS_Alloc(&com_text, COM_BUF_SIZE);
|
VS_Alloc(&com_text, COM_BUF_SIZE);
|
||||||
|
|
||||||
|
// cheats is a special cvar, so register it ASAP
|
||||||
|
CV_RegisterVar(&cv_cheats);
|
||||||
|
|
||||||
// add standard commands
|
// add standard commands
|
||||||
COM_AddCommand("alias", COM_Alias_f);
|
COM_AddCommand("alias", COM_Alias_f);
|
||||||
COM_AddCommand("echo", COM_Echo_f);
|
COM_AddCommand("echo", COM_Echo_f);
|
||||||
|
|
@ -1582,16 +1594,20 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
|
||||||
{
|
{
|
||||||
boolean override = false;
|
boolean override = false;
|
||||||
INT32 overrideval = 0;
|
INT32 overrideval = 0;
|
||||||
|
|
||||||
// If we want messages informing us if cheats have been enabled or disabled,
|
|
||||||
// we need to rework the consvars a little bit. This call crashes the game
|
|
||||||
// on load because not all variables will be registered at that time.
|
|
||||||
/* boolean prevcheats = false;
|
|
||||||
if (var->flags & CV_CHEAT)
|
|
||||||
prevcheats = CV_CheatsEnabled(); */
|
|
||||||
|
|
||||||
const char *overridestr = valstr;
|
const char *overridestr = valstr;
|
||||||
|
|
||||||
|
if ((var->flags & CV_CHEAT) && CV_CheatsEnabled() == false)
|
||||||
|
{
|
||||||
|
// Enforce to default value without cheats.
|
||||||
|
if (stricmp(var->defaultvalue, valstr) != 0)
|
||||||
|
{
|
||||||
|
// Warn the user about this.
|
||||||
|
CONS_Printf("This cannot be used without cheats enabled.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
valstr = overridestr = var->defaultvalue;
|
||||||
|
}
|
||||||
|
|
||||||
if (CV_CompleteValue(var, &overridestr, &overrideval))
|
if (CV_CompleteValue(var, &overridestr, &overrideval))
|
||||||
{
|
{
|
||||||
if (overridestr)
|
if (overridestr)
|
||||||
|
|
@ -1644,17 +1660,6 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
|
||||||
var->value = atoi(var->string);
|
var->value = atoi(var->string);
|
||||||
}
|
}
|
||||||
|
|
||||||
// See the note above.
|
|
||||||
/* if (var->flags & CV_CHEAT)
|
|
||||||
{
|
|
||||||
boolean newcheats = CV_CheatsEnabled();
|
|
||||||
|
|
||||||
if (!prevcheats && newcheats)
|
|
||||||
CONS_Printf(M_GetText("Cheats have been enabled.\n"));
|
|
||||||
else if (prevcheats && !newcheats)
|
|
||||||
CONS_Printf(M_GetText("Cheats have been disabled.\n"));
|
|
||||||
} */
|
|
||||||
|
|
||||||
if (var->flags & CV_SHOWMODIFONETIME || var->flags & CV_SHOWMODIF)
|
if (var->flags & CV_SHOWMODIFONETIME || var->flags & CV_SHOWMODIF)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("%s set to %s\n"), var->name, var->string);
|
CONS_Printf(M_GetText("%s set to %s\n"), var->name, var->string);
|
||||||
|
|
@ -1664,10 +1669,13 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
|
||||||
{
|
{
|
||||||
DEBFILE(va("%s set to %s\n", var->name, var->string));
|
DEBFILE(va("%s set to %s\n", var->name, var->string));
|
||||||
}
|
}
|
||||||
|
|
||||||
var->flags |= CV_MODIFIED;
|
var->flags |= CV_MODIFIED;
|
||||||
|
|
||||||
// raise 'on change' code
|
// raise 'on change' code
|
||||||
LUA_CVarChanged(var); // let consolelib know what cvar this is.
|
LUA_CVarChanged(var); // let consolelib know what cvar this is.
|
||||||
if (var->flags & CV_CALL && !stealth)
|
|
||||||
|
if ((var->flags & CV_CALL) && !stealth)
|
||||||
var->func();
|
var->func();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
@ -1765,7 +1773,14 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
|
||||||
cvar = ReadNetVar(p, &svalue, &stealth);
|
cvar = ReadNetVar(p, &svalue, &stealth);
|
||||||
|
|
||||||
if (cvar)
|
if (cvar)
|
||||||
|
{
|
||||||
Setvalue(cvar, svalue, stealth);
|
Setvalue(cvar, svalue, stealth);
|
||||||
|
|
||||||
|
if ((cvar->flags & CV_CHEAT) && stricmp(cvar->string, cvar->defaultvalue) != 0) // use cvar->string to compare what it is now
|
||||||
|
{
|
||||||
|
CV_CheaterWarning(playernum, va("%s %s", cvar->name, svalue)); // but use svalue to show what they inputted
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CV_SaveVars(UINT8 **p, boolean in_demo)
|
void CV_SaveVars(UINT8 **p, boolean in_demo)
|
||||||
|
|
@ -1867,14 +1882,33 @@ void CV_LoadDemoVars(UINT8 **p)
|
||||||
|
|
||||||
static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth);
|
static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth);
|
||||||
|
|
||||||
void CV_ResetCheatNetVars(void)
|
void CV_CheatsChanged(void)
|
||||||
|
{
|
||||||
|
if (CV_CheatsEnabled())
|
||||||
|
{
|
||||||
|
G_SetUsedCheats();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
consvar_t *cvar;
|
consvar_t *cvar;
|
||||||
|
UINT8 i;
|
||||||
|
|
||||||
// Stealthset everything back to default.
|
// Set everything back to default.
|
||||||
for (cvar = consvar_vars; cvar; cvar = cvar->next)
|
for (cvar = consvar_vars; cvar; cvar = cvar->next)
|
||||||
if (cvar->flags & CV_CHEAT)
|
if (cvar->flags & CV_CHEAT)
|
||||||
CV_SetCVar(cvar, cvar->defaultvalue, true);
|
CV_SetCVar(cvar, cvar->defaultvalue, false);
|
||||||
|
|
||||||
|
// Reset any other cheat command effects here, as well.
|
||||||
|
cv_debug = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (!playeringame[i])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
players[i].cheats = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the variable's current value is its default value
|
// Returns true if the variable's current value is its default value
|
||||||
|
|
@ -1885,16 +1919,18 @@ boolean CV_IsSetToDefault(consvar_t *v)
|
||||||
|
|
||||||
// If any cheats CVars are not at their default settings, return true.
|
// If any cheats CVars are not at their default settings, return true.
|
||||||
// Else return false.
|
// Else return false.
|
||||||
// This returns a UINT8 because I'm too lazy to deal with the packet structure.
|
boolean CV_CheatsEnabled(void)
|
||||||
// Deal with it. =P
|
|
||||||
UINT8 CV_CheatsEnabled(void)
|
|
||||||
{
|
{
|
||||||
consvar_t *cvar;
|
return (boolean)cv_cheats.value;
|
||||||
|
}
|
||||||
|
|
||||||
for (cvar = consvar_vars; cvar; cvar = cvar->next)
|
// Consistent print about cheaters in multiplayer.
|
||||||
if ((cvar->flags & CV_CHEAT) && strcmp(cvar->defaultvalue, cvar->string))
|
void CV_CheaterWarning(UINT8 playerID, const char *command)
|
||||||
return 1;
|
{
|
||||||
return 0;
|
if (netgame)
|
||||||
|
{
|
||||||
|
CONS_Printf("\x85" "%s cheats:" "\x80" " %s\n", player_names[playerID], command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets a value to a variable, performing some checks and calling the
|
/** Sets a value to a variable, performing some checks and calling the
|
||||||
|
|
|
||||||
|
|
@ -229,10 +229,11 @@ void CV_RevertNetVars(void);
|
||||||
void CV_LoadDemoVars(UINT8 **p);
|
void CV_LoadDemoVars(UINT8 **p);
|
||||||
|
|
||||||
// reset cheat netvars after cheats is deactivated
|
// reset cheat netvars after cheats is deactivated
|
||||||
void CV_ResetCheatNetVars(void);
|
void CV_CheatsChanged(void);
|
||||||
|
|
||||||
boolean CV_IsSetToDefault(consvar_t *v);
|
boolean CV_IsSetToDefault(consvar_t *v);
|
||||||
UINT8 CV_CheatsEnabled(void);
|
boolean CV_CheatsEnabled(void);
|
||||||
|
void CV_CheaterWarning(UINT8 playerID, const char *command);
|
||||||
|
|
||||||
// Returns cvar by name. Exposed here for Lua.
|
// Returns cvar by name. Exposed here for Lua.
|
||||||
consvar_t *CV_FindVar(const char *name);
|
consvar_t *CV_FindVar(const char *name);
|
||||||
|
|
|
||||||
20
src/d_main.c
20
src/d_main.c
|
|
@ -1518,6 +1518,12 @@ void D_SRB2Main(void)
|
||||||
if (M_CheckParm("-noupload"))
|
if (M_CheckParm("-noupload"))
|
||||||
COM_BufAddText("downloading 0\n");
|
COM_BufAddText("downloading 0\n");
|
||||||
|
|
||||||
|
if (M_CheckParm("-gamedata") && M_IsNextParm())
|
||||||
|
{
|
||||||
|
// Moved from G_LoadGameData itself, as it would cause some crazy
|
||||||
|
// confusion issues when loading mods.
|
||||||
|
strlcpy(gamedatafilename, M_GetNextParm(), sizeof gamedatafilename);
|
||||||
|
}
|
||||||
G_LoadGameData();
|
G_LoadGameData();
|
||||||
|
|
||||||
wipegamestate = gamestate;
|
wipegamestate = gamestate;
|
||||||
|
|
@ -1601,7 +1607,7 @@ void D_SRB2Main(void)
|
||||||
{
|
{
|
||||||
if (!M_CheckParm("-server"))
|
if (!M_CheckParm("-server"))
|
||||||
{
|
{
|
||||||
G_SetGameModified(true, true);
|
G_SetUsedCheats();
|
||||||
|
|
||||||
// Start up a "minor" grand prix session
|
// Start up a "minor" grand prix session
|
||||||
memset(&grandprixinfo, 0, sizeof(struct grandprixinfo));
|
memset(&grandprixinfo, 0, sizeof(struct grandprixinfo));
|
||||||
|
|
@ -1814,16 +1820,12 @@ void D_SRB2Main(void)
|
||||||
|
|
||||||
if (server && !M_CheckParm("+map"))
|
if (server && !M_CheckParm("+map"))
|
||||||
{
|
{
|
||||||
// Prevent warping to locked levels
|
if (M_MapLocked(pstartmap))
|
||||||
// ... unless you're in a dedicated server. Yes, technically this means you can view any level by
|
|
||||||
// running a dedicated server and joining it yourself, but that's better than making dedicated server's
|
|
||||||
// lives hell.
|
|
||||||
if (!dedicated && M_MapLocked(pstartmap))
|
|
||||||
I_Error("You need to unlock this level before you can warp to it!\n");
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
D_MapChange(pstartmap, gametype, (cv_kartencore.value == 1), true, 0, false, false);
|
G_SetUsedCheats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
D_MapChange(pstartmap, gametype, (cv_kartencore.value == 1), true, 0, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (M_CheckParm("-skipintro"))
|
else if (M_CheckParm("-skipintro"))
|
||||||
|
|
|
||||||
242
src/d_netcmd.c
242
src/d_netcmd.c
|
|
@ -63,12 +63,6 @@
|
||||||
#include "deh_tables.h"
|
#include "deh_tables.h"
|
||||||
#include "m_perfstats.h"
|
#include "m_perfstats.h"
|
||||||
|
|
||||||
#ifdef NETGAME_DEVMODE
|
|
||||||
#define CV_RESTRICT CV_NETVAR
|
|
||||||
#else
|
|
||||||
#define CV_RESTRICT 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_DISCORDRPC
|
#ifdef HAVE_DISCORDRPC
|
||||||
#include "discord.h"
|
#include "discord.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -153,10 +147,6 @@ static void KartEliminateLast_OnChange(void);
|
||||||
static void Schedule_OnChange(void);
|
static void Schedule_OnChange(void);
|
||||||
static void LiveStudioAudience_OnChange(void);
|
static void LiveStudioAudience_OnChange(void);
|
||||||
|
|
||||||
#ifdef NETGAME_DEVMODE
|
|
||||||
static void Fishcake_OnChange(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void Command_Playdemo_f(void);
|
static void Command_Playdemo_f(void);
|
||||||
static void Command_Timedemo_f(void);
|
static void Command_Timedemo_f(void);
|
||||||
static void Command_Stopdemo_f(void);
|
static void Command_Stopdemo_f(void);
|
||||||
|
|
@ -220,7 +210,6 @@ static void Command_ShowScores_f(void);
|
||||||
static void Command_ShowTime_f(void);
|
static void Command_ShowTime_f(void);
|
||||||
|
|
||||||
static void Command_Isgamemodified_f(void);
|
static void Command_Isgamemodified_f(void);
|
||||||
static void Command_Cheats_f(void);
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
static void Command_Togglemodified_f(void);
|
static void Command_Togglemodified_f(void);
|
||||||
static void Command_Archivetest_f(void);
|
static void Command_Archivetest_f(void);
|
||||||
|
|
@ -258,9 +247,6 @@ static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}
|
||||||
|
|
||||||
consvar_t cv_showinputjoy = CVAR_INIT ("showinputjoy", "Off", 0, CV_OnOff, NULL);
|
consvar_t cv_showinputjoy = CVAR_INIT ("showinputjoy", "Off", 0, CV_OnOff, NULL);
|
||||||
|
|
||||||
#ifdef NETGAME_DEVMODE
|
|
||||||
static consvar_t cv_fishcake = CVAR_INIT ("fishcake", "Off", CV_CALL|CV_NOSHOWHELP|CV_RESTRICT, CV_OnOff, Fishcake_OnChange);
|
|
||||||
#endif
|
|
||||||
static consvar_t cv_dummyconsvar = CVAR_INIT ("dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff, DummyConsvar_OnChange);
|
static consvar_t cv_dummyconsvar = CVAR_INIT ("dummyconsvar", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff, DummyConsvar_OnChange);
|
||||||
|
|
||||||
consvar_t cv_restrictskinchange = CVAR_INIT ("restrictskinchange", "Yes", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL);
|
consvar_t cv_restrictskinchange = CVAR_INIT ("restrictskinchange", "Yes", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL);
|
||||||
|
|
@ -376,44 +362,44 @@ consvar_t cv_joyscale[MAXSPLITSCREENPLAYERS] = { //Alam: Dummy for save
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
consvar_t cv_superring = CVAR_INIT ("superring", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_superring = CVAR_INIT ("superring", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_sneaker = CVAR_INIT ("sneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_sneaker = CVAR_INIT ("sneaker", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_rocketsneaker = CVAR_INIT ("rocketsneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_rocketsneaker = CVAR_INIT ("rocketsneaker", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_invincibility = CVAR_INIT ("invincibility", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_invincibility = CVAR_INIT ("invincibility", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_banana = CVAR_INIT ("banana", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_banana = CVAR_INIT ("banana", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_eggmanmonitor = CVAR_INIT ("eggmanmonitor", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_eggmanmonitor = CVAR_INIT ("eggmanmonitor", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_orbinaut = CVAR_INIT ("orbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_orbinaut = CVAR_INIT ("orbinaut", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_jawz = CVAR_INIT ("jawz", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_jawz = CVAR_INIT ("jawz", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_mine = CVAR_INIT ("mine", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_mine = CVAR_INIT ("mine", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_landmine = CVAR_INIT ("landmine", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_landmine = CVAR_INIT ("landmine", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_droptarget = CVAR_INIT ("droptarget", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_droptarget = CVAR_INIT ("droptarget", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_ballhog = CVAR_INIT ("ballhog", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_ballhog = CVAR_INIT ("ballhog", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_selfpropelledbomb = CVAR_INIT ("selfpropelledbomb", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_selfpropelledbomb = CVAR_INIT ("selfpropelledbomb", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_grow = CVAR_INIT ("grow", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_grow = CVAR_INIT ("grow", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_shrink = CVAR_INIT ("shrink", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_shrink = CVAR_INIT ("shrink", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_lightningshield = CVAR_INIT ("lightningshield", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_lightningshield = CVAR_INIT ("lightningshield", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_bubbleshield = CVAR_INIT ("bubbleshield", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_bubbleshield = CVAR_INIT ("bubbleshield", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_flameshield = CVAR_INIT ("flameshield", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_flameshield = CVAR_INIT ("flameshield", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_hyudoro = CVAR_INIT ("hyudoro", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_hyudoro = CVAR_INIT ("hyudoro", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_pogospring = CVAR_INIT ("pogospring", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_pogospring = CVAR_INIT ("pogospring", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_kitchensink = CVAR_INIT ("kitchensink", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_kitchensink = CVAR_INIT ("kitchensink", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
|
|
||||||
consvar_t cv_dualsneaker = CVAR_INIT ("dualsneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_dualsneaker = CVAR_INIT ("dualsneaker", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_triplesneaker = CVAR_INIT ("triplesneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_triplesneaker = CVAR_INIT ("triplesneaker", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_triplebanana = CVAR_INIT ("triplebanana", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_triplebanana = CVAR_INIT ("triplebanana", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_decabanana = CVAR_INIT ("decabanana", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_decabanana = CVAR_INIT ("decabanana", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_tripleorbinaut = CVAR_INIT ("tripleorbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_tripleorbinaut = CVAR_INIT ("tripleorbinaut", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_quadorbinaut = CVAR_INIT ("quadorbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_quadorbinaut = CVAR_INIT ("quadorbinaut", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
consvar_t cv_dualjawz = CVAR_INIT ("dualjawz", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
consvar_t cv_dualjawz = CVAR_INIT ("dualjawz", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
|
|
||||||
static CV_PossibleValue_t kartminimap_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t kartminimap_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_kartminimap = CVAR_INIT ("kartminimap", "4", CV_SAVE, kartminimap_cons_t, NULL);
|
consvar_t cv_kartminimap = CVAR_INIT ("kartminimap", "4", CV_SAVE, kartminimap_cons_t, NULL);
|
||||||
consvar_t cv_kartcheck = CVAR_INIT ("kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL);
|
consvar_t cv_kartcheck = CVAR_INIT ("kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL);
|
||||||
consvar_t cv_kartspeed = CVAR_INIT ("kartspeed", "Auto", CV_NETVAR|CV_CALL|CV_NOINIT, kartspeed_cons_t, KartSpeed_OnChange);
|
consvar_t cv_kartspeed = CVAR_INIT ("kartspeed", "Auto", CV_NETVAR|CV_CALL|CV_NOINIT, kartspeed_cons_t, KartSpeed_OnChange);
|
||||||
static CV_PossibleValue_t kartbumpers_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t kartbumpers_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_kartbumpers = CVAR_INIT ("kartbumpers", "3", CV_NETVAR|CV_CHEAT, kartbumpers_cons_t, NULL);
|
consvar_t cv_kartbumpers = CVAR_INIT ("kartbumpers", "3", CV_NETVAR, kartbumpers_cons_t, NULL);
|
||||||
consvar_t cv_kartfrantic = CVAR_INIT ("kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange);
|
consvar_t cv_kartfrantic = CVAR_INIT ("kartfrantic", "Off", CV_NETVAR|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange);
|
||||||
consvar_t cv_kartcomeback = CVAR_INIT ("kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange);
|
consvar_t cv_kartcomeback = CVAR_INIT ("kartcomeback", "On", CV_NETVAR|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange);
|
||||||
static CV_PossibleValue_t kartencore_cons_t[] = {{-1, "Auto"}, {0, "Off"}, {1, "On"}, {0, NULL}};
|
static CV_PossibleValue_t kartencore_cons_t[] = {{-1, "Auto"}, {0, "Off"}, {1, "On"}, {0, NULL}};
|
||||||
consvar_t cv_kartencore = CVAR_INIT ("kartencore", "Auto", CV_NETVAR|CV_CALL|CV_NOINIT, kartencore_cons_t, KartEncore_OnChange);
|
consvar_t cv_kartencore = CVAR_INIT ("kartencore", "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}};
|
static CV_PossibleValue_t kartvoterulechanges_cons_t[] = {{0, "Never"}, {1, "Sometimes"}, {2, "Frequent"}, {3, "Always"}, {0, NULL}};
|
||||||
|
|
@ -444,9 +430,9 @@ static CV_PossibleValue_t kartbot_cons_t[] = {
|
||||||
};
|
};
|
||||||
consvar_t cv_kartbot = CVAR_INIT ("kartbot", "0", CV_NETVAR, kartbot_cons_t, NULL);
|
consvar_t cv_kartbot = CVAR_INIT ("kartbot", "0", CV_NETVAR, kartbot_cons_t, NULL);
|
||||||
|
|
||||||
consvar_t cv_karteliminatelast = CVAR_INIT ("karteliminatelast", "Yes", CV_NETVAR|CV_CHEAT|CV_CALL, CV_YesNo, KartEliminateLast_OnChange);
|
consvar_t cv_karteliminatelast = CVAR_INIT ("karteliminatelast", "Yes", CV_NETVAR|CV_CALL, CV_YesNo, KartEliminateLast_OnChange);
|
||||||
|
|
||||||
consvar_t cv_kartusepwrlv = CVAR_INIT ("kartusepwrlv", "Yes", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL);
|
consvar_t cv_kartusepwrlv = CVAR_INIT ("kartusepwrlv", "Yes", CV_NETVAR, CV_YesNo, NULL);
|
||||||
|
|
||||||
static CV_PossibleValue_t kartdebugitem_cons_t[] =
|
static CV_PossibleValue_t kartdebugitem_cons_t[] =
|
||||||
{
|
{
|
||||||
|
|
@ -455,37 +441,30 @@ static CV_PossibleValue_t kartdebugitem_cons_t[] =
|
||||||
#undef FOREACH
|
#undef FOREACH
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "0", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugitem_cons_t, NULL);
|
consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "None", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL);
|
||||||
static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugamount_cons_t, NULL);
|
consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT, kartdebugamount_cons_t, NULL);
|
||||||
#ifdef DEVELOP
|
|
||||||
#define VALUE "Yes"
|
|
||||||
#else
|
|
||||||
#define VALUE "No"
|
|
||||||
#endif
|
|
||||||
consvar_t cv_kartallowgiveitem = CVAR_INIT ("kartallowgiveitem", VALUE, CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_YesNo, NULL);
|
|
||||||
#undef VALUE
|
|
||||||
|
|
||||||
consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
||||||
consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
||||||
static CV_PossibleValue_t kartdebugwaypoint_cons_t[] = {{0, "Off"}, {1, "Forwards"}, {2, "Backwards"}, {0, NULL}};
|
static CV_PossibleValue_t kartdebugwaypoint_cons_t[] = {{0, "Off"}, {1, "Forwards"}, {2, "Backwards"}, {0, NULL}};
|
||||||
consvar_t cv_kartdebugwaypoints = CVAR_INIT ("kartdebugwaypoints", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugwaypoint_cons_t, NULL);
|
consvar_t cv_kartdebugwaypoints = CVAR_INIT ("kartdebugwaypoints", "Off", CV_NETVAR|CV_CHEAT, kartdebugwaypoint_cons_t, NULL);
|
||||||
consvar_t cv_kartdebugbotpredict = CVAR_INIT ("kartdebugbotpredict", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugbotpredict = CVAR_INIT ("kartdebugbotpredict", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
||||||
|
|
||||||
consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_CHEAT, CV_OnOff, NULL);
|
||||||
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_CHEAT, CV_OnOff, NULL);
|
||||||
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_CHEAT, CV_OnOff, NULL);
|
||||||
consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
|
consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", CV_CHEAT, CV_OnOff, NULL);
|
||||||
|
|
||||||
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL);
|
consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL);
|
||||||
|
|
||||||
consvar_t cv_gravity = CVAR_INIT ("gravity", "0.8", CV_RESTRICT|CV_FLOAT|CV_CALL, NULL, Gravity_OnChange); // change DEFAULT_GRAVITY if you change this
|
consvar_t cv_gravity = CVAR_INIT ("gravity", "0.8", CV_CHEAT|CV_FLOAT|CV_CALL, NULL, Gravity_OnChange); // change DEFAULT_GRAVITY if you change this
|
||||||
|
|
||||||
consvar_t cv_soundtest = CVAR_INIT ("soundtest", "0", CV_CALL, NULL, SoundTest_OnChange);
|
consvar_t cv_soundtest = CVAR_INIT ("soundtest", "0", CV_CALL, NULL, SoundTest_OnChange);
|
||||||
|
|
||||||
static CV_PossibleValue_t minitimelimit_cons_t[] = {{15, "MIN"}, {9999, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t minitimelimit_cons_t[] = {{15, "MIN"}, {9999, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_countdowntime = CVAR_INIT ("countdowntime", "30", CV_NETVAR|CV_CHEAT, minitimelimit_cons_t, NULL);
|
consvar_t cv_countdowntime = CVAR_INIT ("countdowntime", "30", CV_NETVAR, minitimelimit_cons_t, NULL);
|
||||||
|
|
||||||
consvar_t cv_autobalance = CVAR_INIT ("autobalance", "Off", CV_SAVE|CV_NETVAR|CV_CALL, CV_OnOff, AutoBalance_OnChange);
|
consvar_t cv_autobalance = CVAR_INIT ("autobalance", "Off", CV_SAVE|CV_NETVAR|CV_CALL, CV_OnOff, AutoBalance_OnChange);
|
||||||
consvar_t cv_teamscramble = CVAR_INIT ("teamscramble", "Off", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, teamscramble_cons_t, TeamScramble_OnChange);
|
consvar_t cv_teamscramble = CVAR_INIT ("teamscramble", "Off", CV_SAVE|CV_NETVAR|CV_CALL|CV_NOINIT, teamscramble_cons_t, TeamScramble_OnChange);
|
||||||
|
|
@ -494,7 +473,7 @@ consvar_t cv_scrambleonchange = CVAR_INIT ("scrambleonchange", "Off", CV_SAVE|CV
|
||||||
consvar_t cv_itemfinder = CVAR_INIT ("itemfinder", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff, ItemFinder_OnChange);
|
consvar_t cv_itemfinder = CVAR_INIT ("itemfinder", "Off", CV_CALL|CV_NOSHOWHELP, CV_OnOff, ItemFinder_OnChange);
|
||||||
|
|
||||||
// Scoring type options
|
// Scoring type options
|
||||||
consvar_t cv_overtime = CVAR_INIT ("overtime", "Yes", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL);
|
consvar_t cv_overtime = CVAR_INIT ("overtime", "Yes", CV_NETVAR, CV_YesNo, NULL);
|
||||||
|
|
||||||
consvar_t cv_rollingdemos = CVAR_INIT ("rollingdemos", "On", CV_SAVE, CV_OnOff, NULL);
|
consvar_t cv_rollingdemos = CVAR_INIT ("rollingdemos", "On", CV_SAVE, CV_OnOff, NULL);
|
||||||
|
|
||||||
|
|
@ -746,7 +725,6 @@ void D_RegisterServerCommands(void)
|
||||||
COM_AddCommand("isgamemodified", Command_Isgamemodified_f); // test
|
COM_AddCommand("isgamemodified", Command_Isgamemodified_f); // test
|
||||||
COM_AddCommand("showscores", Command_ShowScores_f);
|
COM_AddCommand("showscores", Command_ShowScores_f);
|
||||||
COM_AddCommand("showtime", Command_ShowTime_f);
|
COM_AddCommand("showtime", Command_ShowTime_f);
|
||||||
COM_AddCommand("cheats", Command_Cheats_f); // test
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
COM_AddCommand("togglemodified", Command_Togglemodified_f);
|
COM_AddCommand("togglemodified", Command_Togglemodified_f);
|
||||||
COM_AddCommand("archivetest", Command_Archivetest_f);
|
COM_AddCommand("archivetest", Command_Archivetest_f);
|
||||||
|
|
@ -972,10 +950,6 @@ void D_RegisterClientCommands(void)
|
||||||
CV_RegisterVar(&cv_netticbuffer);
|
CV_RegisterVar(&cv_netticbuffer);
|
||||||
CV_RegisterVar(&cv_mindelay);
|
CV_RegisterVar(&cv_mindelay);
|
||||||
|
|
||||||
#ifdef NETGAME_DEVMODE
|
|
||||||
CV_RegisterVar(&cv_fishcake);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// HUD
|
// HUD
|
||||||
CV_RegisterVar(&cv_itemfinder);
|
CV_RegisterVar(&cv_itemfinder);
|
||||||
CV_RegisterVar(&cv_showinputjoy);
|
CV_RegisterVar(&cv_showinputjoy);
|
||||||
|
|
@ -2686,7 +2660,8 @@ static void Command_Map_f(void)
|
||||||
const char *gametypename;
|
const char *gametypename;
|
||||||
boolean newresetplayers;
|
boolean newresetplayers;
|
||||||
|
|
||||||
boolean mustmodifygame;
|
boolean usingcheats;
|
||||||
|
boolean ischeating;
|
||||||
|
|
||||||
INT32 newmapnum;
|
INT32 newmapnum;
|
||||||
|
|
||||||
|
|
@ -2710,20 +2685,8 @@ static void Command_Map_f(void)
|
||||||
option_skill = COM_CheckPartialParm("-s");
|
option_skill = COM_CheckPartialParm("-s");
|
||||||
newresetplayers = ! COM_CheckParm("-noresetplayers");
|
newresetplayers = ! COM_CheckParm("-noresetplayers");
|
||||||
|
|
||||||
mustmodifygame = !(netgame || multiplayer) && !majormods;
|
usingcheats = CV_CheatsEnabled();
|
||||||
|
ischeating = (!(netgame || multiplayer)) || (!newresetplayers);
|
||||||
if (mustmodifygame && !option_force)
|
|
||||||
{
|
|
||||||
/* May want to be more descriptive? */
|
|
||||||
CONS_Printf(M_GetText("Sorry, level change disabled in single player.\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!newresetplayers && !cv_debug)
|
|
||||||
{
|
|
||||||
CONS_Printf(M_GetText("DEVMODE must be enabled.\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (option_gametype)
|
if (option_gametype)
|
||||||
{
|
{
|
||||||
|
|
@ -2766,9 +2729,15 @@ static void Command_Map_f(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mustmodifygame && option_force)
|
if (M_MapLocked(newmapnum))
|
||||||
{
|
{
|
||||||
G_SetGameModified(multiplayer, true);
|
ischeating = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ischeating && !usingcheats)
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("Cheats must be enabled.\n"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// new gametype value
|
// new gametype value
|
||||||
|
|
@ -2825,7 +2794,7 @@ static void Command_Map_f(void)
|
||||||
{
|
{
|
||||||
newencoremode = !newencoremode;
|
newencoremode = !newencoremode;
|
||||||
|
|
||||||
if (!M_SecretUnlocked(SECRET_ENCORE) && newencoremode == true && !option_force)
|
if (!M_SecretUnlocked(SECRET_ENCORE) && newencoremode == true && !usingcheats)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("You haven't unlocked Encore Mode yet!\n"));
|
CONS_Alert(CONS_NOTICE, M_GetText("You haven't unlocked Encore Mode yet!\n"));
|
||||||
return;
|
return;
|
||||||
|
|
@ -2837,10 +2806,12 @@ static void Command_Map_f(void)
|
||||||
|
|
||||||
// don't use a gametype the map doesn't support
|
// don't use a gametype the map doesn't support
|
||||||
if (cv_debug || option_force || cv_skipmapcheck.value)
|
if (cv_debug || option_force || cv_skipmapcheck.value)
|
||||||
|
{
|
||||||
fromlevelselect = false; // The player wants us to trek on anyway. Do so.
|
fromlevelselect = false; // The player wants us to trek on anyway. Do so.
|
||||||
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer
|
||||||
if (!(
|
if (!(
|
||||||
mapheaderinfo[newmapnum-1] &&
|
mapheaderinfo[newmapnum-1] &&
|
||||||
mapheaderinfo[newmapnum-1]->typeoflevel & G_TOLFlag(newgametype)
|
mapheaderinfo[newmapnum-1]->typeoflevel & G_TOLFlag(newgametype)
|
||||||
|
|
@ -2938,18 +2909,6 @@ static void Command_Map_f(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent warping to locked levels
|
|
||||||
// ... unless you're in a dedicated server. Yes, technically this means you can view any level by
|
|
||||||
// running a dedicated server and joining it yourself, but that's better than making dedicated server's
|
|
||||||
// lives hell.
|
|
||||||
if (!dedicated && M_MapLocked(newmapnum))
|
|
||||||
{
|
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("You need to unlock this level before you can warp to it!\n"));
|
|
||||||
Z_Free(realmapname);
|
|
||||||
Z_Free(mapname);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tutorialmode = false; // warping takes us out of tutorial mode
|
tutorialmode = false; // warping takes us out of tutorial mode
|
||||||
|
|
||||||
D_MapChange(newmapnum, newgametype, newencoremode, newresetplayers, 0, false, fromlevelselect);
|
D_MapChange(newmapnum, newgametype, newencoremode, newresetplayers, 0, false, fromlevelselect);
|
||||||
|
|
@ -4984,23 +4943,12 @@ void D_GameTypeChanged(INT32 lastgametype)
|
||||||
|
|
||||||
static void Gravity_OnChange(void)
|
static void Gravity_OnChange(void)
|
||||||
{
|
{
|
||||||
if (!M_SecretUnlocked(SECRET_PANDORA) && !netgame && !cv_debug
|
|
||||||
&& strcmp(cv_gravity.string, cv_gravity.defaultvalue))
|
|
||||||
{
|
|
||||||
CONS_Printf(M_GetText("You haven't earned this yet.\n"));
|
|
||||||
CV_StealthSet(&cv_gravity, cv_gravity.defaultvalue);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#ifndef NETGAME_GRAVITY
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
{
|
{
|
||||||
CV_StealthSet(&cv_gravity, cv_gravity.defaultvalue);
|
// TODO: multiplayer support
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!CV_IsSetToDefault(&cv_gravity))
|
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
gravity = cv_gravity.value;
|
gravity = cv_gravity.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5219,7 +5167,7 @@ static void Command_Mapmd5_f(void)
|
||||||
|
|
||||||
static void Command_ExitLevel_f(void)
|
static void Command_ExitLevel_f(void)
|
||||||
{
|
{
|
||||||
if (!(netgame || multiplayer) && !cv_debug)
|
if (!(netgame || multiplayer) && !CV_CheatsEnabled())
|
||||||
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||||
else if (!(server || (IsPlayerAdmin(consoleplayer))))
|
else if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||||
|
|
@ -5340,7 +5288,7 @@ static void Got_GiveItemcmd(UINT8 **cp, INT32 playernum)
|
||||||
amt = READUINT8 (*cp);
|
amt = READUINT8 (*cp);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
( netgame && ! cv_kartallowgiveitem.value ) ||
|
( !CV_CheatsEnabled() ) ||
|
||||||
( item < KITEM_SAD || item >= NUMKARTITEMS )
|
( item < KITEM_SAD || item >= NUMKARTITEMS )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
@ -5352,8 +5300,18 @@ static void Got_GiveItemcmd(UINT8 **cp, INT32 playernum)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
K_StripItems(&players[playernum]);
|
||||||
|
players[playernum].itemroulette = 0;
|
||||||
|
|
||||||
players[playernum].itemtype = item;
|
players[playernum].itemtype = item;
|
||||||
players[playernum].itemamount = amt;
|
players[playernum].itemamount = amt;
|
||||||
|
|
||||||
|
CV_CheaterWarning(
|
||||||
|
playernum,
|
||||||
|
(amt != 1) // FIXME: we should have actual KITEM_ name array
|
||||||
|
? va("kartgiveitem %s %d", cv_kartdebugitem.PossibleValue[item+1].strvalue, amt)
|
||||||
|
: va("kartgiveitem %s", cv_kartdebugitem.PossibleValue[item+1].strvalue)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Got_ScheduleTaskcmd(UINT8 **cp, INT32 playernum)
|
static void Got_ScheduleTaskcmd(UINT8 **cp, INT32 playernum)
|
||||||
|
|
@ -5534,23 +5492,6 @@ void Command_Retry_f(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NETGAME_DEVMODE
|
|
||||||
// Allow the use of devmode in netgames.
|
|
||||||
static void Fishcake_OnChange(void)
|
|
||||||
{
|
|
||||||
cv_debug = cv_fishcake.value;
|
|
||||||
// consvar_t's get changed to default when registered
|
|
||||||
// so don't make modifiedgame always on!
|
|
||||||
if (cv_debug)
|
|
||||||
{
|
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (cv_debug != cv_fishcake.value)
|
|
||||||
CV_SetValue(&cv_fishcake, cv_debug);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Reports to the console whether or not the game has been modified.
|
/** Reports to the console whether or not the game has been modified.
|
||||||
*
|
*
|
||||||
* \todo Make it obvious, so a console command won't be necessary.
|
* \todo Make it obvious, so a console command won't be necessary.
|
||||||
|
|
@ -5569,27 +5510,6 @@ static void Command_Isgamemodified_f(void)
|
||||||
CONS_Printf("The game has not been modified. You can play Record Attack, earn medals and unlock extras.\n");
|
CONS_Printf("The game has not been modified. You can play Record Attack, earn medals and unlock extras.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Command_Cheats_f(void)
|
|
||||||
{
|
|
||||||
if (COM_CheckParm("off"))
|
|
||||||
{
|
|
||||||
if (!(server || (IsPlayerAdmin(consoleplayer))))
|
|
||||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
|
||||||
else
|
|
||||||
CV_ResetCheatNetVars();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CV_CheatsEnabled())
|
|
||||||
{
|
|
||||||
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed -- Cheats are enabled.\n"));
|
|
||||||
if (server || (IsPlayerAdmin(consoleplayer)))
|
|
||||||
CONS_Printf(M_GetText("Type CHEATS OFF to reset all cheat variables to default.\n"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
CONS_Printf(M_GetText("No CHEAT-marked variables are changed -- Cheats are disabled.\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
static void Command_Togglemodified_f(void)
|
static void Command_Togglemodified_f(void)
|
||||||
{
|
{
|
||||||
|
|
@ -5642,8 +5562,6 @@ static void Command_Archivetest_f(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Give yourself an, optional quantity or one of, an item.
|
/** Give yourself an, optional quantity or one of, an item.
|
||||||
*
|
|
||||||
* \sa cv_kartallowgiveitem
|
|
||||||
*/
|
*/
|
||||||
static void Command_KartGiveItem_f(void)
|
static void Command_KartGiveItem_f(void)
|
||||||
{
|
{
|
||||||
|
|
@ -5657,8 +5575,7 @@ static void Command_KartGiveItem_f(void)
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Allow always in local games. */
|
if (CV_CheatsEnabled())
|
||||||
if (! netgame || cv_kartallowgiveitem.value)
|
|
||||||
{
|
{
|
||||||
ac = COM_Argc();
|
ac = COM_Argc();
|
||||||
if (ac < 2)
|
if (ac < 2)
|
||||||
|
|
@ -5710,8 +5627,7 @@ static void Command_KartGiveItem_f(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE,
|
CONS_Printf("This cannot be used without cheats enabled.\n");
|
||||||
"The server does not allow this.\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6123,7 +6039,7 @@ static void Skin_OnChange(void)
|
||||||
if (!Playing())
|
if (!Playing())
|
||||||
return; // do whatever you want
|
return; // do whatever you want
|
||||||
|
|
||||||
if (!(cv_debug || devparm) && !(multiplayer || netgame) // In single player.
|
if (!CV_CheatsEnabled() && !(multiplayer || netgame) // In single player.
|
||||||
&& (gamestate != GS_WAITINGPLAYERS)) // allows command line -warp x +skin y
|
&& (gamestate != GS_WAITINGPLAYERS)) // allows command line -warp x +skin y
|
||||||
{
|
{
|
||||||
CV_StealthSet(&cv_skin[0], skins[players[consoleplayer].skin].name);
|
CV_StealthSet(&cv_skin[0], skins[players[consoleplayer].skin].name);
|
||||||
|
|
@ -6199,7 +6115,7 @@ static void Color_OnChange(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(cv_debug || devparm) && !(multiplayer || netgame)) // In single player.
|
if (!CV_CheatsEnabled() && !(multiplayer || netgame)) // In single player.
|
||||||
{
|
{
|
||||||
CV_StealthSet(&cv_skin[0], skins[players[consoleplayer].skin].name);
|
CV_StealthSet(&cv_skin[0], skins[players[consoleplayer].skin].name);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ extern consvar_t cv_kartusepwrlv;
|
||||||
|
|
||||||
extern consvar_t cv_votetime;
|
extern consvar_t cv_votetime;
|
||||||
|
|
||||||
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartallowgiveitem, cv_kartdebugshrink, cv_kartdebugdistribution, cv_kartdebughuddrop;
|
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugdistribution, cv_kartdebughuddrop;
|
||||||
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector;
|
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector;
|
||||||
extern consvar_t cv_kartdebugwaypoints, cv_kartdebugbotpredict;
|
extern consvar_t cv_kartdebugwaypoints, cv_kartdebugbotpredict;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,8 @@ typedef enum
|
||||||
|
|
||||||
// Accessibility and cheats
|
// Accessibility and cheats
|
||||||
PF_KICKSTARTACCEL = 1<<4, // Is accelerate in kickstart mode?
|
PF_KICKSTARTACCEL = 1<<4, // Is accelerate in kickstart mode?
|
||||||
PF_GODMODE = 1<<5,
|
// 1<<5 free
|
||||||
PF_NOCLIP = 1<<6,
|
// 1<<6 free
|
||||||
|
|
||||||
PF_WANTSTOJOIN = 1<<7, // Spectator that wants to join
|
PF_WANTSTOJOIN = 1<<7, // Spectator that wants to join
|
||||||
|
|
||||||
|
|
@ -105,6 +105,13 @@ typedef enum
|
||||||
// up to 1<<31 is free
|
// up to 1<<31 is free
|
||||||
} pflags_t;
|
} pflags_t;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
PC_GODMODE = 1,
|
||||||
|
PC_NOCLIP = 1<<1,
|
||||||
|
// up to 1<<31 is free
|
||||||
|
} pcheats_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
// Are animation frames playing?
|
// Are animation frames playing?
|
||||||
|
|
@ -365,6 +372,7 @@ typedef struct player_s
|
||||||
// Bit flags.
|
// Bit flags.
|
||||||
// See pflags_t, above.
|
// See pflags_t, above.
|
||||||
pflags_t pflags;
|
pflags_t pflags;
|
||||||
|
pcheats_t cheats;
|
||||||
|
|
||||||
// playing animation.
|
// playing animation.
|
||||||
panim_t panim;
|
panim_t panim;
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ extern char logfilename[1024];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* A mod name to further distinguish versions. */
|
/* A mod name to further distinguish versions. */
|
||||||
#define SRB2APPLICATION "SRB2Kart"
|
#define SRB2APPLICATION "RingRacers"
|
||||||
|
|
||||||
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
|
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
|
||||||
#ifdef DEVELOP
|
#ifdef DEVELOP
|
||||||
|
|
@ -139,7 +139,7 @@ extern char logfilename[1024];
|
||||||
#define VERSIONSTRINGW WSTRING (VERSIONSTRING)
|
#define VERSIONSTRINGW WSTRING (VERSIONSTRING)
|
||||||
|
|
||||||
/* A custom URL protocol for server links. */
|
/* A custom URL protocol for server links. */
|
||||||
#define SERVER_URL_PROTOCOL "srb2kart://"
|
#define SERVER_URL_PROTOCOL "ringracers://"
|
||||||
|
|
||||||
// Does this version require an added patch file?
|
// Does this version require an added patch file?
|
||||||
// Comment or uncomment this as necessary.
|
// Comment or uncomment this as necessary.
|
||||||
|
|
@ -618,12 +618,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||||
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
// None of these that are disabled in the normal build are guaranteed to work perfectly
|
||||||
// Compile them at your own risk!
|
// Compile them at your own risk!
|
||||||
|
|
||||||
/// Allows the use of devmode in multiplayer. AKA "fishcake"
|
|
||||||
//#define NETGAME_DEVMODE
|
|
||||||
|
|
||||||
/// Allows gravity changes in netgames, no questions asked.
|
|
||||||
//#define NETGAME_GRAVITY
|
|
||||||
|
|
||||||
/// Dumps the contents of a network save game upon consistency failure for debugging.
|
/// Dumps the contents of a network save game upon consistency failure for debugging.
|
||||||
//#define DUMPCONSISTENCY
|
//#define DUMPCONSISTENCY
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ extern boolean modifiedgame;
|
||||||
extern boolean majormods;
|
extern boolean majormods;
|
||||||
extern UINT16 mainwads;
|
extern UINT16 mainwads;
|
||||||
extern boolean savemoddata; // This mod saves time/emblem data.
|
extern boolean savemoddata; // This mod saves time/emblem data.
|
||||||
|
extern boolean usedCheats;
|
||||||
extern boolean imcontinuing; // Temporary flag while continuing
|
extern boolean imcontinuing; // Temporary flag while continuing
|
||||||
extern boolean metalrecording;
|
extern boolean metalrecording;
|
||||||
|
|
||||||
|
|
@ -653,8 +654,6 @@ extern INT16 scrambleteams[MAXPLAYERS]; //for CTF team scramble
|
||||||
extern INT16 scrambletotal; //for CTF team scramble
|
extern INT16 scrambletotal; //for CTF team scramble
|
||||||
extern INT16 scramblecount; //for CTF team scramble
|
extern INT16 scramblecount; //for CTF team scramble
|
||||||
|
|
||||||
extern INT32 cheats;
|
|
||||||
|
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
extern UINT8 numlaps;
|
extern UINT8 numlaps;
|
||||||
extern UINT8 gamespeed;
|
extern UINT8 gamespeed;
|
||||||
|
|
|
||||||
|
|
@ -1029,7 +1029,7 @@ void F_GameEvaluationDrawer(void)
|
||||||
{
|
{
|
||||||
V_DrawString(8, 16, V_YELLOWMAP, "Unlocked:");
|
V_DrawString(8, 16, V_YELLOWMAP, "Unlocked:");
|
||||||
|
|
||||||
if (!(netgame) && (!modifiedgame || savemoddata))
|
if (!usedCheats)
|
||||||
{
|
{
|
||||||
INT32 startcoord = 32;
|
INT32 startcoord = 32;
|
||||||
|
|
||||||
|
|
@ -1044,10 +1044,8 @@ void F_GameEvaluationDrawer(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (netgame)
|
|
||||||
V_DrawString(8, 96, V_YELLOWMAP, "Multiplayer games\ncan't unlock\nextras!");
|
|
||||||
else
|
else
|
||||||
V_DrawString(8, 96, V_YELLOWMAP, "Modified games\ncan't unlock\nextras!");
|
V_DrawString(8, 96, V_YELLOWMAP, "Cheated games\ncan't unlock\nextras!");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -1101,14 +1099,7 @@ void F_GameEvaluationTicker(void)
|
||||||
|
|
||||||
if (finalecount == 5*TICRATE)
|
if (finalecount == 5*TICRATE)
|
||||||
{
|
{
|
||||||
if (netgame || multiplayer) // modify this when we finally allow unlocking stuff in 2P
|
if (!usedCheats)
|
||||||
{
|
|
||||||
HU_SetCEchoFlags(V_YELLOWMAP);
|
|
||||||
HU_SetCEchoDuration(6);
|
|
||||||
HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Multiplayer games can't unlock extras!");
|
|
||||||
S_StartSound(NULL, sfx_s3k68);
|
|
||||||
}
|
|
||||||
else if (!modifiedgame || savemoddata)
|
|
||||||
{
|
{
|
||||||
++timesBeaten;
|
++timesBeaten;
|
||||||
|
|
||||||
|
|
@ -1121,7 +1112,7 @@ void F_GameEvaluationTicker(void)
|
||||||
{
|
{
|
||||||
HU_SetCEchoFlags(V_YELLOWMAP);
|
HU_SetCEchoFlags(V_YELLOWMAP);
|
||||||
HU_SetCEchoDuration(6);
|
HU_SetCEchoDuration(6);
|
||||||
HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Modified games can't unlock extras!");
|
HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Cheated games can't unlock extras!");
|
||||||
S_StartSound(NULL, sfx_s3k68);
|
S_StartSound(NULL, sfx_s3k68);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
129
src/g_game.c
129
src/g_game.c
|
|
@ -128,6 +128,7 @@ UINT16 mainwads = 0;
|
||||||
boolean modifiedgame = false; // Set if homebrew PWAD stuff has been added.
|
boolean modifiedgame = false; // Set if homebrew PWAD stuff has been added.
|
||||||
boolean majormods = false; // Set if Lua/Gameplay SOC/replacement map has been added.
|
boolean majormods = false; // Set if Lua/Gameplay SOC/replacement map has been added.
|
||||||
boolean savemoddata = false;
|
boolean savemoddata = false;
|
||||||
|
boolean usedCheats = false; // Set when a "cheats on" is ever used.
|
||||||
UINT8 paused;
|
UINT8 paused;
|
||||||
UINT8 modeattacking = ATTACKING_NONE;
|
UINT8 modeattacking = ATTACKING_NONE;
|
||||||
boolean imcontinuing = false;
|
boolean imcontinuing = false;
|
||||||
|
|
@ -288,8 +289,6 @@ INT16 scrambleteams[MAXPLAYERS]; //for CTF team scramble
|
||||||
INT16 scrambletotal; //for CTF team scramble
|
INT16 scrambletotal; //for CTF team scramble
|
||||||
INT16 scramblecount; //for CTF team scramble
|
INT16 scramblecount; //for CTF team scramble
|
||||||
|
|
||||||
INT32 cheats; //for multiplayer cheat commands
|
|
||||||
|
|
||||||
// SRB2Kart
|
// SRB2Kart
|
||||||
// Cvars that we don't want changed mid-game
|
// Cvars that we don't want changed mid-game
|
||||||
UINT8 numlaps; // Removed from Cvar hell
|
UINT8 numlaps; // Removed from Cvar hell
|
||||||
|
|
@ -630,6 +629,21 @@ void G_SetGameModified(boolean silent, boolean major)
|
||||||
Command_ExitGame_f();
|
Command_ExitGame_f();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for consistency among messages: this sets cheats as used.
|
||||||
|
void G_SetUsedCheats(void)
|
||||||
|
{
|
||||||
|
if (usedCheats)
|
||||||
|
return;
|
||||||
|
|
||||||
|
usedCheats = true;
|
||||||
|
CONS_Alert(CONS_NOTICE, M_GetText("Cheats activated -- game must be restarted to save progress.\n"));
|
||||||
|
|
||||||
|
// If in record attack recording, cancel it.
|
||||||
|
if (modeattacking)
|
||||||
|
M_EndModeAttackRun();
|
||||||
|
else if (marathonmode)
|
||||||
|
Command_ExitGame_f();
|
||||||
|
}
|
||||||
/** Returns the map lump name for a map number.
|
/** Returns the map lump name for a map number.
|
||||||
*
|
*
|
||||||
* \param map Map number.
|
* \param map Map number.
|
||||||
|
|
@ -2204,6 +2218,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
UINT32 followitem;
|
UINT32 followitem;
|
||||||
|
|
||||||
INT32 pflags;
|
INT32 pflags;
|
||||||
|
INT32 cheats;
|
||||||
|
|
||||||
UINT8 ctfteam;
|
UINT8 ctfteam;
|
||||||
|
|
||||||
|
|
@ -2283,6 +2298,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
botrival = players[player].botvars.rival;
|
botrival = players[player].botvars.rival;
|
||||||
|
|
||||||
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_KICKSTARTACCEL|PF_SHRINKME|PF_SHRINKACTIVE));
|
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_KICKSTARTACCEL|PF_SHRINKME|PF_SHRINKACTIVE));
|
||||||
|
cheats = 0;
|
||||||
|
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
if (betweenmaps || leveltime < introtime)
|
if (betweenmaps || leveltime < introtime)
|
||||||
|
|
@ -2359,7 +2375,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
|
|
||||||
// As long as we're not in multiplayer, carry over cheatcodes from map to map
|
// As long as we're not in multiplayer, carry over cheatcodes from map to map
|
||||||
if (!(netgame || multiplayer))
|
if (!(netgame || multiplayer))
|
||||||
pflags |= (players[player].pflags & (PF_GODMODE|PF_NOCLIP));
|
cheats = players[player].cheats;
|
||||||
|
|
||||||
if (!betweenmaps)
|
if (!betweenmaps)
|
||||||
{
|
{
|
||||||
|
|
@ -2376,6 +2392,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
||||||
p->roundscore = roundscore;
|
p->roundscore = roundscore;
|
||||||
p->lives = lives;
|
p->lives = lives;
|
||||||
p->pflags = pflags;
|
p->pflags = pflags;
|
||||||
|
p->cheats = cheats;
|
||||||
p->ctfteam = ctfteam;
|
p->ctfteam = ctfteam;
|
||||||
p->jointime = jointime;
|
p->jointime = jointime;
|
||||||
p->splitscreenindex = splitscreenindex;
|
p->splitscreenindex = splitscreenindex;
|
||||||
|
|
@ -3469,7 +3486,7 @@ tryagain:
|
||||||
|
|
||||||
if ((mapheaderinfo[ix]->typeoflevel & tolflags) != tolflags
|
if ((mapheaderinfo[ix]->typeoflevel & tolflags) != tolflags
|
||||||
|| ix == pprevmap
|
|| ix == pprevmap
|
||||||
|| (!dedicated && M_MapLocked(ix+1))
|
|| M_MapLocked(ix+1)
|
||||||
|| (usehellmaps != (mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU))) // this is bad
|
|| (usehellmaps != (mapheaderinfo[ix]->menuflags & LF2_HIDEINMENU))) // this is bad
|
||||||
continue; //isokmap = false;
|
continue; //isokmap = false;
|
||||||
|
|
||||||
|
|
@ -3604,13 +3621,33 @@ void G_AddMapToBuffer(INT16 map)
|
||||||
//
|
//
|
||||||
static void G_UpdateVisited(void)
|
static void G_UpdateVisited(void)
|
||||||
{
|
{
|
||||||
// Update visitation flags?
|
UINT8 i;
|
||||||
if (/*(!majormods || savemoddata) // Not modified
|
|
||||||
&&*/ !multiplayer && !demo.playback // SP/RA/NiGHTS mode
|
|
||||||
&& !(modeattacking && (players[consoleplayer].pflags & PF_NOCONTEST))) // Not failed
|
|
||||||
{
|
|
||||||
UINT8 earnedEmblems;
|
UINT8 earnedEmblems;
|
||||||
|
|
||||||
|
// No demos.
|
||||||
|
if (demo.playback)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Check if every local player wiped out.
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (!playeringame[i]) // Not here.
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!P_IsLocalPlayer(&players[i])) // Not local.
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (players[i].spectator) // Not playing.
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (players[i].pflags & PF_NOCONTEST) // Sonic after not surviving.
|
||||||
|
continue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == MAXPLAYERS) // Not a single living local soul?
|
||||||
|
return;
|
||||||
|
|
||||||
// Update visitation flags
|
// Update visitation flags
|
||||||
mapheaderinfo[gamemap-1]->mapvisited |= MV_BEATEN;
|
mapheaderinfo[gamemap-1]->mapvisited |= MV_BEATEN;
|
||||||
|
|
||||||
|
|
@ -3625,7 +3662,6 @@ static void G_UpdateVisited(void)
|
||||||
if ((earnedEmblems = M_CompletionEmblems()))
|
if ((earnedEmblems = M_CompletionEmblems()))
|
||||||
CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : "");
|
CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : "");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static boolean CanSaveLevel(INT32 mapnum)
|
static boolean CanSaveLevel(INT32 mapnum)
|
||||||
{
|
{
|
||||||
|
|
@ -3650,15 +3686,17 @@ static void G_HandleSaveLevel(void)
|
||||||
remove(liveeventbackup);
|
remove(liveeventbackup);
|
||||||
cursaveslot = 0;
|
cursaveslot = 0;
|
||||||
}
|
}
|
||||||
else if ((!modifiedgame || savemoddata) && !(netgame || multiplayer || ultimatemode || demo.recording || metalrecording || modeattacking))
|
else if (!usedCheats && !(netgame || multiplayer || ultimatemode || demo.recording || metalrecording || modeattacking))
|
||||||
G_SaveGame((UINT32)cursaveslot, 0); // TODO when we readd a campaign one day
|
G_SaveGame((UINT32)cursaveslot, 0); // TODO when we readd a campaign one day
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// and doing THIS here means you don't lose your progress if you close the game mid-intermission
|
// and doing THIS here means you don't lose your progress if you close the game mid-intermission
|
||||||
else if (!(ultimatemode || netgame || multiplayer || demo.playback || demo.recording || metalrecording || modeattacking)
|
else if (!(ultimatemode || demo.playback || demo.recording || metalrecording || modeattacking)
|
||||||
&& (!modifiedgame || savemoddata) && cursaveslot > 0 && CanSaveLevel(lastmap+1))
|
&& cursaveslot > 0 && CanSaveLevel(lastmap+1))
|
||||||
|
{
|
||||||
G_SaveGame((UINT32)cursaveslot, lastmap+1); // not nextmap+1 to route around special stages
|
G_SaveGame((UINT32)cursaveslot, lastmap+1); // not nextmap+1 to route around special stages
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void G_GetNextMap(void)
|
static void G_GetNextMap(void)
|
||||||
{
|
{
|
||||||
|
|
@ -4065,7 +4103,7 @@ static void G_DoContinued(void)
|
||||||
tokenlist = 0;
|
tokenlist = 0;
|
||||||
token = 0;
|
token = 0;
|
||||||
|
|
||||||
if (!(netgame || multiplayer || demo.playback || demo.recording || metalrecording || modeattacking) && (!modifiedgame || savemoddata) && cursaveslot > 0)
|
if (!(netgame || multiplayer || demo.playback || demo.recording || metalrecording || modeattacking) && !usedCheats && cursaveslot > 0)
|
||||||
G_SaveGameOver((UINT32)cursaveslot, true);
|
G_SaveGameOver((UINT32)cursaveslot, true);
|
||||||
|
|
||||||
// Reset # of lives
|
// Reset # of lives
|
||||||
|
|
@ -4126,7 +4164,7 @@ void G_LoadGameSettings(void)
|
||||||
S_InitRuntimeSounds();
|
S_InitRuntimeSounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GD_VERSIONCHECK 0xBA5ED444
|
#define GD_VERSIONCHECK 0xBA5ED444 // Change every major version, as usual
|
||||||
|
|
||||||
// G_LoadGameData
|
// G_LoadGameData
|
||||||
// Loads the main data file, which stores information such as emblems found, etc.
|
// Loads the main data file, which stores information such as emblems found, etc.
|
||||||
|
|
@ -4134,12 +4172,15 @@ void G_LoadGameData(void)
|
||||||
{
|
{
|
||||||
size_t length;
|
size_t length;
|
||||||
UINT32 i, j;
|
UINT32 i, j;
|
||||||
UINT8 modded = false;
|
UINT32 versionID;
|
||||||
UINT8 rtemp;
|
UINT8 rtemp;
|
||||||
|
|
||||||
//For records
|
//For records
|
||||||
UINT32 numgamedatamapheaders;
|
UINT32 numgamedatamapheaders;
|
||||||
|
|
||||||
|
// Stop saving, until we successfully load it again.
|
||||||
|
gamedataloaded = false;
|
||||||
|
|
||||||
// Clear things so previously read gamedata doesn't transfer
|
// Clear things so previously read gamedata doesn't transfer
|
||||||
// to new gamedata
|
// to new gamedata
|
||||||
G_ClearRecords(); // main and nights records
|
G_ClearRecords(); // main and nights records
|
||||||
|
|
@ -4149,27 +4190,31 @@ void G_LoadGameData(void)
|
||||||
matchesplayed = 0; // SRB2Kart: matches played & finished
|
matchesplayed = 0; // SRB2Kart: matches played & finished
|
||||||
|
|
||||||
if (M_CheckParm("-nodata"))
|
if (M_CheckParm("-nodata"))
|
||||||
return; // Don't load.
|
|
||||||
|
|
||||||
// Allow saving of gamedata beyond this point
|
|
||||||
gamedataloaded = true;
|
|
||||||
|
|
||||||
if (M_CheckParm("-gamedata") && M_IsNextParm())
|
|
||||||
{
|
{
|
||||||
strlcpy(gamedatafilename, M_GetNextParm(), sizeof gamedatafilename);
|
// Don't load at all.
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (M_CheckParm("-resetdata"))
|
if (M_CheckParm("-resetdata"))
|
||||||
return; // Don't load (essentially, reset).
|
{
|
||||||
|
// Don't load, but do save. (essentially, reset)
|
||||||
|
gamedataloaded = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
length = FIL_ReadFile(va(pandf, srb2home, gamedatafilename), &savebuffer);
|
length = FIL_ReadFile(va(pandf, srb2home, gamedatafilename), &savebuffer);
|
||||||
if (!length) // Aw, no game data. Their loss!
|
if (!length)
|
||||||
|
{
|
||||||
|
// No gamedata. We can save a new one.
|
||||||
|
gamedataloaded = true;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
save_p = savebuffer;
|
save_p = savebuffer;
|
||||||
|
|
||||||
// Version check
|
// Version check
|
||||||
if (READUINT32(save_p) != GD_VERSIONCHECK)
|
versionID = READUINT32(save_p);
|
||||||
|
if (versionID != GD_VERSIONCHECK)
|
||||||
{
|
{
|
||||||
const char *gdfolder = "the Ring Racers folder";
|
const char *gdfolder = "the Ring Racers folder";
|
||||||
if (strcmp(srb2home,"."))
|
if (strcmp(srb2home,"."))
|
||||||
|
|
@ -4177,19 +4222,23 @@ void G_LoadGameData(void)
|
||||||
|
|
||||||
Z_Free(savebuffer);
|
Z_Free(savebuffer);
|
||||||
save_p = NULL;
|
save_p = NULL;
|
||||||
I_Error("Game data is from another version of SRB2.\nDelete %s (maybe in %s) and try again.", gamedatafilename, gdfolder);
|
I_Error("Game data is not for Ring Racers v2.0.\nDelete %s(maybe in %s) and try again.", gamedatafilename, gdfolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
totalplaytime = READUINT32(save_p);
|
totalplaytime = READUINT32(save_p);
|
||||||
matchesplayed = READUINT32(save_p);
|
matchesplayed = READUINT32(save_p);
|
||||||
|
|
||||||
modded = READUINT8(save_p);
|
{
|
||||||
|
// Quick & dirty hash for what mod this save file is for.
|
||||||
|
UINT32 modID = READUINT32(save_p);
|
||||||
|
UINT32 expectedID = quickncasehash(timeattackfolder, 64);
|
||||||
|
|
||||||
|
if (modID != expectedID)
|
||||||
|
{
|
||||||
// Aha! Someone's been screwing with the save file!
|
// Aha! Someone's been screwing with the save file!
|
||||||
if ((modded && !savemoddata))
|
|
||||||
goto datacorrupt;
|
|
||||||
else if (modded != true && modded != false)
|
|
||||||
goto datacorrupt;
|
goto datacorrupt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// To save space, use one bit per collected/achieved/unlocked flag
|
// To save space, use one bit per collected/achieved/unlocked flag
|
||||||
for (i = 0; i < MAXEMBLEMS;)
|
for (i = 0; i < MAXEMBLEMS;)
|
||||||
|
|
@ -4269,6 +4318,12 @@ void G_LoadGameData(void)
|
||||||
Z_Free(savebuffer);
|
Z_Free(savebuffer);
|
||||||
save_p = NULL;
|
save_p = NULL;
|
||||||
|
|
||||||
|
// Don't consider loaded until it's a success!
|
||||||
|
// It used to do this much earlier, but this would cause the gamedata to
|
||||||
|
// save over itself when it I_Errors from the corruption landing point below,
|
||||||
|
// which can accidentally delete players' legitimate data if the code ever has any tiny mistakes!
|
||||||
|
gamedataloaded = true;
|
||||||
|
|
||||||
// Silent update unlockables in case they're out of sync with conditions
|
// Silent update unlockables in case they're out of sync with conditions
|
||||||
M_SilentUpdateUnlockablesAndEmblems();
|
M_SilentUpdateUnlockablesAndEmblems();
|
||||||
|
|
||||||
|
|
@ -4309,23 +4364,19 @@ void G_SaveGameData(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
if (usedCheats)
|
||||||
// SRB2Kart: Let players unlock stuff with addons.
|
|
||||||
if (modifiedgame && !savemoddata)
|
|
||||||
{
|
{
|
||||||
free(savebuffer);
|
free(savebuffer);
|
||||||
save_p = savebuffer = NULL;
|
save_p = savebuffer = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Version test
|
// Version test
|
||||||
WRITEUINT32(save_p, GD_VERSIONCHECK); // 4
|
|
||||||
|
|
||||||
|
WRITEUINT32(save_p, GD_VERSIONCHECK); // 4
|
||||||
WRITEUINT32(save_p, totalplaytime); // 4
|
WRITEUINT32(save_p, totalplaytime); // 4
|
||||||
WRITEUINT32(save_p, matchesplayed); // 4
|
WRITEUINT32(save_p, matchesplayed); // 4
|
||||||
|
WRITEUINT32(save_p, quickncasehash(timeattackfolder, 64));
|
||||||
WRITEUINT8(save_p, (UINT8)savemoddata); // 1
|
|
||||||
|
|
||||||
// To save space, use one bit per collected/achieved/unlocked flag
|
// To save space, use one bit per collected/achieved/unlocked flag
|
||||||
for (i = 0; i < MAXEMBLEMS;) // MAXEMBLEMS * 1;
|
for (i = 0; i < MAXEMBLEMS;) // MAXEMBLEMS * 1;
|
||||||
|
|
@ -4733,7 +4784,7 @@ void G_InitNew(UINT8 pencoremode, INT32 map, boolean resetplayer, boolean skippr
|
||||||
memset(&players[i].respawn, 0, sizeof (players[i].respawn));
|
memset(&players[i].respawn, 0, sizeof (players[i].respawn));
|
||||||
|
|
||||||
// Clear cheatcodes too, just in case.
|
// Clear cheatcodes too, just in case.
|
||||||
players[i].pflags &= ~(PF_GODMODE|PF_NOCLIP);
|
players[i].cheats = 0;
|
||||||
|
|
||||||
players[i].roundscore = 0;
|
players[i].roundscore = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -239,6 +239,7 @@ void G_LoadGameData(void);
|
||||||
void G_LoadGameSettings(void);
|
void G_LoadGameSettings(void);
|
||||||
|
|
||||||
void G_SetGameModified(boolean silent, boolean major);
|
void G_SetGameModified(boolean silent, boolean major);
|
||||||
|
void G_SetUsedCheats(void);
|
||||||
|
|
||||||
void G_SetGamestate(gamestate_t newstate);
|
void G_SetGamestate(gamestate_t newstate);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,6 @@ void K_RegisterKartStuff(void)
|
||||||
|
|
||||||
CV_RegisterVar(&cv_kartdebugitem);
|
CV_RegisterVar(&cv_kartdebugitem);
|
||||||
CV_RegisterVar(&cv_kartdebugamount);
|
CV_RegisterVar(&cv_kartdebugamount);
|
||||||
CV_RegisterVar(&cv_kartallowgiveitem);
|
|
||||||
CV_RegisterVar(&cv_kartdebugdistribution);
|
CV_RegisterVar(&cv_kartdebugdistribution);
|
||||||
CV_RegisterVar(&cv_kartdebughuddrop);
|
CV_RegisterVar(&cv_kartdebughuddrop);
|
||||||
CV_RegisterVar(&cv_kartdebugwaypoints);
|
CV_RegisterVar(&cv_kartdebugwaypoints);
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ static UINT8 cheatf_warp(void)
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
G_SaveGameData(); //G_SetGameModified(false);
|
G_SaveGameData(); //G_SetUsedCheats();
|
||||||
S_StartSound(0, sfx_kc42);
|
S_StartSound(0, sfx_kc42);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ static UINT8 cheatf_devmode(void)
|
||||||
S_StartSound(0, sfx_itemup);
|
S_StartSound(0, sfx_itemup);
|
||||||
|
|
||||||
// Just unlock all the things and turn on -debug and console devmode.
|
// Just unlock all the things and turn on -debug and console devmode.
|
||||||
G_SetGameModified(false, false); // might need to revist the latter later
|
G_SetUsedCheats();
|
||||||
for (i = 0; i < MAXUNLOCKABLES; i++)
|
for (i = 0; i < MAXUNLOCKABLES; i++)
|
||||||
unlockables[i].unlocked = true;
|
unlockables[i].unlocked = true;
|
||||||
devparm = true;
|
devparm = true;
|
||||||
|
|
@ -236,11 +236,8 @@ boolean cht_Responder(event_t *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Console cheat commands rely on these a lot...
|
// Console cheat commands rely on these a lot...
|
||||||
#define REQUIRE_PANDORA if (!M_SecretUnlocked(SECRET_PANDORA) && !cv_debug)\
|
#define REQUIRE_CHEATS if (!CV_CheatsEnabled())\
|
||||||
{ CONS_Printf(M_GetText("You haven't earned this yet.\n")); return; }
|
{ CONS_Printf(M_GetText("Cheats must be enabled.\n")); return; }
|
||||||
|
|
||||||
#define REQUIRE_DEVMODE if (!cv_debug)\
|
|
||||||
{ CONS_Printf(M_GetText("DEVMODE must be enabled.\n")); return; }
|
|
||||||
|
|
||||||
#define REQUIRE_OBJECTPLACE if (!objectplacing)\
|
#define REQUIRE_OBJECTPLACE if (!objectplacing)\
|
||||||
{ CONS_Printf(M_GetText("OBJECTPLACE must be enabled.\n")); return; }
|
{ CONS_Printf(M_GetText("OBJECTPLACE must be enabled.\n")); return; }
|
||||||
|
|
@ -256,37 +253,35 @@ void Command_CheatNoClip_f(void)
|
||||||
{
|
{
|
||||||
player_t *plyr;
|
player_t *plyr;
|
||||||
|
|
||||||
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make netplay compatible
|
||||||
|
|
||||||
plyr = &players[consoleplayer];
|
plyr = &players[consoleplayer];
|
||||||
|
|
||||||
if (!plyr->mo || P_MobjWasRemoved(plyr->mo))
|
if (!plyr->mo || P_MobjWasRemoved(plyr->mo))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
plyr->pflags ^= PF_NOCLIP;
|
plyr->cheats ^= PC_NOCLIP;
|
||||||
CONS_Printf(M_GetText("No Clipping %s\n"), plyr->pflags & PF_NOCLIP ? M_GetText("On") : M_GetText("Off"));
|
CONS_Printf(M_GetText("No Clipping %s\n"), plyr->cheats & PC_NOCLIP ? M_GetText("On") : M_GetText("Off"));
|
||||||
|
|
||||||
if (plyr->pflags & PF_NOCLIP)
|
if (plyr->cheats & PC_NOCLIP)
|
||||||
plyr->mo->flags |= MF_NOCLIP;
|
plyr->mo->flags |= MF_NOCLIP;
|
||||||
else
|
else
|
||||||
plyr->mo->flags &= ~MF_NOCLIP;
|
plyr->mo->flags &= ~MF_NOCLIP;
|
||||||
|
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Command_CheatGod_f(void)
|
void Command_CheatGod_f(void)
|
||||||
{
|
{
|
||||||
player_t *plyr;
|
player_t *plyr;
|
||||||
|
|
||||||
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
plyr = &players[consoleplayer];
|
plyr = &players[consoleplayer];
|
||||||
plyr->pflags ^= PF_GODMODE;
|
plyr->cheats ^= PC_GODMODE;
|
||||||
CONS_Printf(M_GetText("Cheese Mode %s\n"), plyr->pflags & PF_GODMODE ? M_GetText("On") : M_GetText("Off"));
|
CONS_Printf(M_GetText("Cheese Mode %s\n"), plyr->cheats & PC_GODMODE ? M_GetText("On") : M_GetText("Off"));
|
||||||
|
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Command_Scale_f(void)
|
void Command_Scale_f(void)
|
||||||
|
|
@ -294,9 +289,9 @@ void Command_Scale_f(void)
|
||||||
const double scaled = atof(COM_Argv(1));
|
const double scaled = atof(COM_Argv(1));
|
||||||
fixed_t scale = FLOAT_TO_FIXED(scaled);
|
fixed_t scale = FLOAT_TO_FIXED(scaled);
|
||||||
|
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
if (scale < FRACUNIT/100 || scale > 100*FRACUNIT) //COM_Argv(1) will return a null string if they did not give a paramater, so...
|
if (scale < FRACUNIT/100 || scale > 100*FRACUNIT) //COM_Argv(1) will return a null string if they did not give a paramater, so...
|
||||||
{
|
{
|
||||||
|
|
@ -314,9 +309,9 @@ void Command_Scale_f(void)
|
||||||
|
|
||||||
void Command_Gravflip_f(void)
|
void Command_Gravflip_f(void)
|
||||||
{
|
{
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
if (players[consoleplayer].mo)
|
if (players[consoleplayer].mo)
|
||||||
players[consoleplayer].mo->flags2 ^= MF2_OBJECTFLIP;
|
players[consoleplayer].mo->flags2 ^= MF2_OBJECTFLIP;
|
||||||
|
|
@ -324,9 +319,9 @@ void Command_Gravflip_f(void)
|
||||||
|
|
||||||
void Command_Hurtme_f(void)
|
void Command_Hurtme_f(void)
|
||||||
{
|
{
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
if (COM_Argc() < 2)
|
if (COM_Argc() < 2)
|
||||||
{
|
{
|
||||||
|
|
@ -344,9 +339,9 @@ void Command_RTeleport_f(void)
|
||||||
player_t *p = &players[consoleplayer];
|
player_t *p = &players[consoleplayer];
|
||||||
subsector_t *ss;
|
subsector_t *ss;
|
||||||
|
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
if (COM_Argc() < 3 || COM_Argc() > 7)
|
if (COM_Argc() < 3 || COM_Argc() > 7)
|
||||||
{
|
{
|
||||||
|
|
@ -406,9 +401,9 @@ void Command_Teleport_f(void)
|
||||||
player_t *p = &players[consoleplayer];
|
player_t *p = &players[consoleplayer];
|
||||||
subsector_t *ss;
|
subsector_t *ss;
|
||||||
|
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
if (COM_Argc() < 3 || COM_Argc() > 11)
|
if (COM_Argc() < 3 || COM_Argc() > 11)
|
||||||
{
|
{
|
||||||
|
|
@ -622,9 +617,9 @@ void Command_Teleport_f(void)
|
||||||
|
|
||||||
void Command_Skynum_f(void)
|
void Command_Skynum_f(void)
|
||||||
{
|
{
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
if (COM_Argc() != 2)
|
if (COM_Argc() != 2)
|
||||||
{
|
{
|
||||||
|
|
@ -640,9 +635,9 @@ void Command_Skynum_f(void)
|
||||||
|
|
||||||
void Command_Weather_f(void)
|
void Command_Weather_f(void)
|
||||||
{
|
{
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
if (COM_Argc() != 2)
|
if (COM_Argc() != 2)
|
||||||
{
|
{
|
||||||
|
|
@ -660,9 +655,9 @@ void Command_Toggletwod_f(void)
|
||||||
{
|
{
|
||||||
player_t *p = &players[consoleplayer];
|
player_t *p = &players[consoleplayer];
|
||||||
|
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
if (p->mo)
|
if (p->mo)
|
||||||
p->mo->flags2 ^= MF2_TWOD;
|
p->mo->flags2 ^= MF2_TWOD;
|
||||||
|
|
@ -675,6 +670,9 @@ void Command_Toggletwod_f(void)
|
||||||
// Don't enable this for normal builds...
|
// Don't enable this for normal builds...
|
||||||
void Command_CauseCfail_f(void)
|
void Command_CauseCfail_f(void)
|
||||||
{
|
{
|
||||||
|
REQUIRE_CHEATS;
|
||||||
|
REQUIRE_INLEVEL;
|
||||||
|
|
||||||
if (consoleplayer == serverplayer)
|
if (consoleplayer == serverplayer)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("Only remote players can use this command.\n"));
|
CONS_Printf(M_GetText("Only remote players can use this command.\n"));
|
||||||
|
|
@ -717,9 +715,9 @@ void Command_Dumplua_f(void)
|
||||||
|
|
||||||
void Command_Savecheckpoint_f(void)
|
void Command_Savecheckpoint_f(void)
|
||||||
{
|
{
|
||||||
REQUIRE_DEVMODE;
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
|
|
||||||
players[consoleplayer].respawn.pointx = players[consoleplayer].mo->x;
|
players[consoleplayer].respawn.pointx = players[consoleplayer].mo->x;
|
||||||
players[consoleplayer].respawn.pointy = players[consoleplayer].mo->y;
|
players[consoleplayer].respawn.pointy = players[consoleplayer].mo->y;
|
||||||
|
|
@ -732,8 +730,8 @@ void Command_Savecheckpoint_f(void)
|
||||||
/*
|
/*
|
||||||
void Command_Getallemeralds_f(void)
|
void Command_Getallemeralds_f(void)
|
||||||
{
|
{
|
||||||
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER;
|
||||||
REQUIRE_PANDORA;
|
|
||||||
|
|
||||||
emeralds = EMERALD_ALL;
|
emeralds = EMERALD_ALL;
|
||||||
|
|
||||||
|
|
@ -742,6 +740,7 @@ void Command_Getallemeralds_f(void)
|
||||||
|
|
||||||
void Command_Resetemeralds_f(void)
|
void Command_Resetemeralds_f(void)
|
||||||
{
|
{
|
||||||
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER;
|
||||||
|
|
||||||
emeralds = 0;
|
emeralds = 0;
|
||||||
|
|
@ -752,9 +751,8 @@ void Command_Resetemeralds_f(void)
|
||||||
|
|
||||||
void Command_Devmode_f(void)
|
void Command_Devmode_f(void)
|
||||||
{
|
{
|
||||||
#ifndef _DEBUG
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_SINGLEPLAYER; // TODO: make multiplayer compatible
|
||||||
#endif
|
|
||||||
|
|
||||||
if (COM_Argc() > 1)
|
if (COM_Argc() > 1)
|
||||||
{
|
{
|
||||||
|
|
@ -771,15 +769,12 @@ void Command_Devmode_f(void)
|
||||||
CONS_Printf(M_GetText("devmode <flags>: enable debugging tools and info, prepend with 0x to use hexadecimal\n"));
|
CONS_Printf(M_GetText("devmode <flags>: enable debugging tools and info, prepend with 0x to use hexadecimal\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Command_Setrings_f(void)
|
void Command_Setrings_f(void)
|
||||||
{
|
{
|
||||||
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
|
||||||
REQUIRE_PANDORA;
|
|
||||||
|
|
||||||
if (COM_Argc() > 1)
|
if (COM_Argc() > 1)
|
||||||
{
|
{
|
||||||
|
|
@ -787,16 +782,13 @@ void Command_Setrings_f(void)
|
||||||
players[consoleplayer].rings = 0;
|
players[consoleplayer].rings = 0;
|
||||||
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
|
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||||
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
|
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
|
||||||
|
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Command_Setlives_f(void)
|
void Command_Setlives_f(void)
|
||||||
{
|
{
|
||||||
|
REQUIRE_CHEATS;
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
|
||||||
REQUIRE_PANDORA;
|
|
||||||
|
|
||||||
if (COM_Argc() > 1)
|
if (COM_Argc() > 1)
|
||||||
{
|
{
|
||||||
|
|
@ -811,8 +803,6 @@ void Command_Setlives_f(void)
|
||||||
players[consoleplayer].lives = 0;
|
players[consoleplayer].lives = 0;
|
||||||
P_GivePlayerLives(&players[consoleplayer], atoi(COM_Argv(1)));
|
P_GivePlayerLives(&players[consoleplayer], atoi(COM_Argv(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1121,7 +1111,6 @@ void OP_ObjectplaceMovement(player_t *player)
|
||||||
void Command_Writethings_f(void)
|
void Command_Writethings_f(void)
|
||||||
{
|
{
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
|
||||||
REQUIRE_OBJECTPLACE;
|
REQUIRE_OBJECTPLACE;
|
||||||
|
|
||||||
P_WriteThings();
|
P_WriteThings();
|
||||||
|
|
@ -1133,9 +1122,8 @@ void Command_ObjectPlace_f(void)
|
||||||
size_t silent;
|
size_t silent;
|
||||||
|
|
||||||
REQUIRE_INLEVEL;
|
REQUIRE_INLEVEL;
|
||||||
REQUIRE_SINGLEPLAYER;
|
REQUIRE_CHEATS;
|
||||||
|
REQUIRE_SINGLEPLAYER; // this one will very likely never be multiplayer compatible...
|
||||||
G_SetGameModified(multiplayer, true);
|
|
||||||
|
|
||||||
silent = COM_CheckParm("-silent");
|
silent = COM_CheckParm("-silent");
|
||||||
|
|
||||||
|
|
|
||||||
13
src/m_cond.c
13
src/m_cond.c
|
|
@ -427,18 +427,23 @@ UINT8 M_SecretUnlocked(INT32 type)
|
||||||
|
|
||||||
UINT8 M_MapLocked(INT32 mapnum)
|
UINT8 M_MapLocked(INT32 mapnum)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef DEVELOP
|
#ifdef DEVELOP
|
||||||
if (1)
|
(void)mapnum;
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#else
|
||||||
if (!mapnum || mapnum > nummapheaders)
|
// Don't lock maps in dedicated servers.
|
||||||
|
// That just makes hosts' lives hell.
|
||||||
|
if (dedicated)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!mapheaderinfo[mapnum-1] || mapheaderinfo[mapnum-1]->unlockrequired < 0)
|
if (!mapheaderinfo[mapnum-1] || mapheaderinfo[mapnum-1]->unlockrequired < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!unlockables[mapheaderinfo[mapnum-1]->unlockrequired].unlocked)
|
if (!unlockables[mapheaderinfo[mapnum-1]->unlockrequired].unlocked)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 M_CountEmblems(void)
|
INT32 M_CountEmblems(void)
|
||||||
|
|
|
||||||
|
|
@ -1874,7 +1874,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
|
|
||||||
if (player) // Player is the target
|
if (player) // Player is the target
|
||||||
{
|
{
|
||||||
if (player->pflags & PF_GODMODE)
|
if (player->cheats & PC_GODMODE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!force)
|
if (!force)
|
||||||
|
|
|
||||||
|
|
@ -2355,7 +2355,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
|
||||||
fixed_t tryy = thiscam->y;
|
fixed_t tryy = thiscam->y;
|
||||||
|
|
||||||
#ifndef NOCLIPCAM
|
#ifndef NOCLIPCAM
|
||||||
if ((players[displayplayers[i]].pflags & PF_NOCLIP) || (leveltime < introtime)) // Noclipping player camera noclips too!!
|
if ((players[displayplayers[i]].cheats & PC_NOCLIP) || (leveltime < introtime)) // Noclipping player camera noclips too!!
|
||||||
#else
|
#else
|
||||||
if (!(players[displayplayers[i]].pflags & PF_NOCONTEST)) // Time Over should not clip through walls
|
if (!(players[displayplayers[i]].pflags & PF_NOCONTEST)) // Time Over should not clip through walls
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
14
src/p_mobj.c
14
src/p_mobj.c
|
|
@ -2082,7 +2082,7 @@ boolean P_CheckDeathPitCollide(mobj_t *mo)
|
||||||
I_Assert(mo != NULL);
|
I_Assert(mo != NULL);
|
||||||
I_Assert(!P_MobjWasRemoved(mo));
|
I_Assert(!P_MobjWasRemoved(mo));
|
||||||
|
|
||||||
if (mo->player && mo->player->pflags & PF_GODMODE)
|
if (mo->player && mo->player->cheats & PC_GODMODE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (((mo->z <= mo->subsector->sector->floorheight
|
if (((mo->z <= mo->subsector->sector->floorheight
|
||||||
|
|
@ -3620,7 +3620,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
||||||
player->karthud[khud_timeovercam] = (2*TICRATE)+1;
|
player->karthud[khud_timeovercam] = (2*TICRATE)+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead.
|
if (!resetcalled && !(player->cheats & PC_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead.
|
||||||
{
|
{
|
||||||
P_ResetCamera(player, thiscam);
|
P_ResetCamera(player, thiscam);
|
||||||
}
|
}
|
||||||
|
|
@ -10651,7 +10651,7 @@ void P_RemoveSavegameMobj(mobj_t *mobj)
|
||||||
|
|
||||||
static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_itemrespawntime = CVAR_INIT ("respawnitemtime", "2", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL);
|
consvar_t cv_itemrespawntime = CVAR_INIT ("respawnitemtime", "2", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL);
|
||||||
consvar_t cv_itemrespawn = CVAR_INIT ("respawnitem", "On", CV_NETVAR, CV_OnOff, NULL);
|
consvar_t cv_itemrespawn = CVAR_INIT ("respawnitem", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
|
||||||
|
|
||||||
static void P_SpawnPrecipitationAt(fixed_t basex, fixed_t basey)
|
static void P_SpawnPrecipitationAt(fixed_t basex, fixed_t basey)
|
||||||
{
|
{
|
||||||
|
|
@ -11533,14 +11533,6 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case MT_EMBLEM:
|
|
||||||
if (netgame || multiplayer)
|
|
||||||
return false; // Single player only
|
|
||||||
|
|
||||||
if (modifiedgame && !savemoddata)
|
|
||||||
return false; // No cheating!!
|
|
||||||
|
|
||||||
break;
|
|
||||||
case MT_ITEMCAPSULE:
|
case MT_ITEMCAPSULE:
|
||||||
{
|
{
|
||||||
boolean isRingCapsule = (mthing->angle < 1 || mthing->angle == KITEM_SUPERRING || mthing->angle >= NUMKARTITEMS);
|
boolean isRingCapsule = (mthing->angle < 1 || mthing->angle == KITEM_SUPERRING || mthing->angle >= NUMKARTITEMS);
|
||||||
|
|
|
||||||
|
|
@ -3938,9 +3938,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
||||||
// Initialize sector node list.
|
// Initialize sector node list.
|
||||||
P_Initsecnode();
|
P_Initsecnode();
|
||||||
|
|
||||||
if (netgame || multiplayer)
|
|
||||||
cv_debug = 0;
|
|
||||||
|
|
||||||
if (metalplayback)
|
if (metalplayback)
|
||||||
G_StopMetalDemo();
|
G_StopMetalDemo();
|
||||||
|
|
||||||
|
|
@ -4285,7 +4282,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
||||||
{
|
{
|
||||||
// I'd love to do this in the menu code instead of here, but everything's a mess and I can't guarantee saving proper player struct info before the first act's started. You could probably refactor it, but it'd be a lot of effort. Easier to just work off known good code. ~toast 22/06/2020
|
// I'd love to do this in the menu code instead of here, but everything's a mess and I can't guarantee saving proper player struct info before the first act's started. You could probably refactor it, but it'd be a lot of effort. Easier to just work off known good code. ~toast 22/06/2020
|
||||||
if (!(ultimatemode || netgame || multiplayer || demo.playback || demo.recording || metalrecording || modeattacking || marathonmode)
|
if (!(ultimatemode || netgame || multiplayer || demo.playback || demo.recording || metalrecording || modeattacking || marathonmode)
|
||||||
&& (!modifiedgame || savemoddata) && cursaveslot > 0)
|
&& !usedCheats && cursaveslot > 0)
|
||||||
G_SaveGame((UINT32)cursaveslot, gamemap);
|
G_SaveGame((UINT32)cursaveslot, gamemap);
|
||||||
// If you're looking for saving sp file progression (distinct from G_SaveGameOver), check G_DoCompleted.
|
// If you're looking for saving sp file progression (distinct from G_SaveGameOver), check G_DoCompleted.
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3130,7 +3130,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NOCLIPCAM
|
#ifndef NOCLIPCAM
|
||||||
cameranoclip = ((player->pflags & PF_NOCLIP)
|
cameranoclip = ((player->cheats & PC_NOCLIP)
|
||||||
|| (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|
|| (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|
||||||
|| (leveltime < introtime)); // Kart intro cam
|
|| (leveltime < introtime)); // Kart intro cam
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ static CV_PossibleValue_t renderhitbox_cons_t[] = {
|
||||||
{RENDERHITBOX_RINGS, "Rings"},
|
{RENDERHITBOX_RINGS, "Rings"},
|
||||||
{0}};
|
{0}};
|
||||||
|
|
||||||
consvar_t cv_renderhitbox = CVAR_INIT ("renderhitbox", "Off", 0, renderhitbox_cons_t, NULL);
|
consvar_t cv_renderhitbox = CVAR_INIT ("renderhitbox", "Off", CV_CHEAT, renderhitbox_cons_t, NULL);
|
||||||
|
|
||||||
struct bbox_col {
|
struct bbox_col {
|
||||||
INT32 x;
|
INT32 x;
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
|
||||||
player->kartweight = skin->kartweight;
|
player->kartweight = skin->kartweight;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (!(cv_debug || devparm) && !(netgame || multiplayer || demo.playback))
|
if (!CV_CheatsEnabled() && !(netgame || multiplayer || demo.playback))
|
||||||
{
|
{
|
||||||
for (i = 0; i <= r_splitscreen; i++)
|
for (i = 0; i <= r_splitscreen; i++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue