From 77668084290e48de839cb5518a8494a1b38bb18d Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Mon, 23 Feb 2015 13:55:25 -0800 Subject: [PATCH] Replace cvar.archive with flags. Add cheat flag. --- 2d/gr.c | 2 +- 2d/palette.c | 2 +- arch/sdl/joy.c | 24 ++++++------ arch/sdl/mouse.c | 12 +++--- main/automap.c | 4 +- main/collide.c | 3 +- main/config.c | 98 ++++++++++++++++++++++++------------------------ main/console.c | 2 +- main/cvar.c | 9 ++++- main/cvar.h | 19 +++++++++- main/escort.c | 6 +-- main/escort.h | 2 +- main/game.c | 23 ++++++------ main/gamecntl.c | 6 ++- main/gameseq.c | 2 +- main/gauges.c | 2 +- main/menu.c | 6 +-- main/movie.c | 2 +- main/multi.c | 8 ++-- main/powerup.c | 2 +- main/songs.c | 2 +- 21 files changed, 130 insertions(+), 106 deletions(-) diff --git a/2d/gr.c b/2d/gr.c index 0d5b31f0..1b80ad6f 100644 --- a/2d/gr.c +++ b/2d/gr.c @@ -22,7 +22,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. int gr_installed = 0; -cvar_t gr_aspectratio = { "r_aspectratio", "0", 0 }; +cvar_t gr_aspectratio = { "r_aspectratio", "0", CVAR_NONE }; // Functions for GR.C diff --git a/2d/palette.c b/2d/palette.c index 26f6e3ca..c1f29da5 100644 --- a/2d/palette.c +++ b/2d/palette.c @@ -51,7 +51,7 @@ ubyte gr_palette[256*3]; ubyte gr_current_pal[256*3]; ubyte gr_fade_table[256*34]; -cvar_t gr_palette_gamma = { "gamma", "0", 0 }; +cvar_t gr_palette_gamma = { "gamma", "0", CVAR_NONE }; int gr_palette_gamma_param = 0; ubyte gr_palette_faded_out = 1; diff --git a/arch/sdl/joy.c b/arch/sdl/joy.c index 216f26c2..937212e1 100644 --- a/arch/sdl/joy.c +++ b/arch/sdl/joy.c @@ -78,21 +78,21 @@ static struct { // 6 = bank left/right cvar_t joy_advaxes[] = { - { "joy_advaxisx", "4", 1 }, - { "joy_advaxisy", "2", 1 }, - { "joy_advaxisz", "0", 1 }, - { "joy_advaxisr", "0", 1 }, - { "joy_advaxisu", "0", 1 }, - { "joy_advaxisv", "0", 1 }, + { "joy_advaxisx", "4", CVAR_ARCHIVE }, + { "joy_advaxisy", "2", CVAR_ARCHIVE }, + { "joy_advaxisz", "0", CVAR_ARCHIVE }, + { "joy_advaxisr", "0", CVAR_ARCHIVE }, + { "joy_advaxisu", "0", CVAR_ARCHIVE }, + { "joy_advaxisv", "0", CVAR_ARCHIVE }, }; cvar_t joy_invert[] = { - { "joy_invertx", "0", 1 }, - { "joy_inverty", "0", 1 }, - { "joy_invertz", "0", 1 }, - { "joy_invertr", "0", 1 }, - { "joy_invertu", "0", 1 }, - { "joy_invertv", "0", 1 }, + { "joy_invertx", "0", CVAR_ARCHIVE }, + { "joy_inverty", "0", CVAR_ARCHIVE }, + { "joy_invertz", "0", CVAR_ARCHIVE }, + { "joy_invertr", "0", CVAR_ARCHIVE }, + { "joy_invertu", "0", CVAR_ARCHIVE }, + { "joy_invertv", "0", CVAR_ARCHIVE }, }; diff --git a/arch/sdl/mouse.c b/arch/sdl/mouse.c index 29188518..76d147db 100644 --- a/arch/sdl/mouse.c +++ b/arch/sdl/mouse.c @@ -32,15 +32,15 @@ static struct mouseinfo { cvar_t mouse_axes[3] = { - { "mouse_axisx", "4", 1 }, - { "mouse_axisy", "2", 1 }, - { "mouse_axisz", "0", 1 }, + { "mouse_axisx", "4", CVAR_ARCHIVE }, + { "mouse_axisy", "2", CVAR_ARCHIVE }, + { "mouse_axisz", "0", CVAR_ARCHIVE }, }; cvar_t mouse_invert[] = { - { "mouse_invertx", "0", 1 }, - { "mouse_inverty", "0", 1 }, - { "mouse_invertz", "0", 1 }, + { "mouse_invertx", "0", CVAR_ARCHIVE }, + { "mouse_inverty", "0", CVAR_ARCHIVE }, + { "mouse_invertz", "0", CVAR_ARCHIVE }, }; diff --git a/main/automap.c b/main/automap.c index 9f05d962..60b2baf5 100644 --- a/main/automap.c +++ b/main/automap.c @@ -609,12 +609,12 @@ int Automap_active = 0; #define MAP_BACKGROUND_FILENAME ((AutomapHires && cfexist("mapb.pcx"))?"MAPB.PCX":"MAP.PCX") #endif -cvar_t Automap_always_hires = { "AutomapHires", "0", 1 }; +cvar_t Automap_always_hires = { "AutomapHires", "0", CVAR_ARCHIVE }; uint32_t automap_mode = SM(640,480); int automap_width = 640; int automap_height = 480; -cvar_t automap_use_game_res = { "AutomapGameres", "0", 1 }; +cvar_t automap_use_game_res = { "AutomapGameres", "0", CVAR_ARCHIVE }; int nice_automap = 0; #define RESCALE_X(x) ((x) * automap_width / 640) diff --git a/main/collide.c b/main/collide.c index 3c49f1a8..10c68c7c 100644 --- a/main/collide.c +++ b/main/collide.c @@ -1301,7 +1301,6 @@ void do_final_boss_hacks(void) Final_boss_is_dead = 1; } -extern int Buddy_dude_cheat; extern int multi_all_players_alive(); void multi_send_finish_game (); @@ -1324,7 +1323,7 @@ int apply_damage_to_robot(object *robot, fix damage, int killer_objnum) // Buddy invulnerable on level 24 so he can give you his important messages. Bah. // Also invulnerable if his cheat for firing weapons is in effect. if (Robot_info[robot->id].companion) { -// if ((PLAYING_BUILTIN_MISSION && Current_level_num == Last_level) || Buddy_dude_cheat) +// if ((PLAYING_BUILTIN_MISSION && Current_level_num == Last_level) || Buddy_dude_cheat.intval) #ifdef NETWORK if (PLAYING_BUILTIN_MISSION && Current_level_num == Last_level) return 0; diff --git a/main/config.c b/main/config.c index 8a36ac39..a30dbe60 100644 --- a/main/config.c +++ b/main/config.c @@ -45,62 +45,62 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef __MSDOS__ -cvar_t Config_digi_type = { "DigiDeviceID8", "0", 1 }; -cvar_t digi_driver_board_16 = { "DigiDeviceID16", "0", 1 }; -//cvar_t digi_driver_port = { "DigiPort", "0", 1 }; -//cvar_t digi_driver_irq = { "DigiIrq", "0", 1 }; -cvar_t Config_digi_dma = { "DigiDma8", "0", 1 }; -cvar_t digi_driver_dma_16 = { "DigiDma16", "0", 1 }; -cvar_t Config_midi_type = { "MidiDeviceID", "0", 1 }; -//cvar_t digi_midi_port = { "MidiPort", "0", 1 }; +cvar_t Config_digi_type = { "DigiDeviceID8", "0", CVAR_ARCHIVE }; +cvar_t digi_driver_board_16 = { "DigiDeviceID16", "0", CVAR_ARCHIVE }; +//cvar_t digi_driver_port = { "DigiPort", "0", CVAR_ARCHIVE }; +//cvar_t digi_driver_irq = { "DigiIrq", "0", CVAR_ARCHIVE }; +cvar_t Config_digi_dma = { "DigiDma8", "0", CVAR_ARCHIVE }; +cvar_t digi_driver_dma_16 = { "DigiDma16", "0", CVAR_ARCHIVE }; +cvar_t Config_midi_type = { "MidiDeviceID", "0", CVAR_ARCHIVE }; +//cvar_t digi_midi_port = { "MidiPort", "0", CVAR_ARCHIVE }; #endif -cvar_t Config_digi_volume = { "DigiVolume", "8", 1 }; -cvar_t Config_midi_volume = { "MidiVolume", "8", 1 }; -cvar_t Config_redbook_volume = { "RedbookVolume", "8", 1 }; -cvar_t Config_detail_level = { "DetailLevel", "4", 1 }; -cvar_t Config_gamma_level = { "GammaLevel", "0", 1 }; -cvar_t Config_control_joystick = { "in_joystick", "0", 1 }; -cvar_t Config_control_mouse = { "in_mouse", "0", 1 }; -cvar_t Config_channels_reversed = { "StereoReverse", "0", 1 }; +cvar_t Config_digi_volume = { "DigiVolume", "8", CVAR_ARCHIVE }; +cvar_t Config_midi_volume = { "MidiVolume", "8", CVAR_ARCHIVE }; +cvar_t Config_redbook_volume = { "RedbookVolume", "8", CVAR_ARCHIVE }; +cvar_t Config_detail_level = { "DetailLevel", "4", CVAR_ARCHIVE }; +cvar_t Config_gamma_level = { "GammaLevel", "0", CVAR_ARCHIVE }; +cvar_t Config_control_joystick = { "in_joystick", "0", CVAR_ARCHIVE }; +cvar_t Config_control_mouse = { "in_mouse", "0", CVAR_ARCHIVE }; +cvar_t Config_channels_reversed = { "StereoReverse", "0", CVAR_ARCHIVE }; cvar_t Config_joystick_sensitivity[] = { - { "joy_forwardsensitivity", "1.0", 1 }, - { "joy_pitchsensitivity", "1.0", 1 }, - { "joy_sidesensitivity", "1.0", 1 }, - { "joy_yawsensitivity", "1.0", 1 }, - { "joy_upsensitivity", "1.0", 1 }, - { "joy_banksensitivity", "1.0", 1 }, + { "joy_forwardsensitivity", "1.0", CVAR_ARCHIVE }, + { "joy_pitchsensitivity", "1.0", CVAR_ARCHIVE }, + { "joy_sidesensitivity", "1.0", CVAR_ARCHIVE }, + { "joy_yawsensitivity", "1.0", CVAR_ARCHIVE }, + { "joy_upsensitivity", "1.0", CVAR_ARCHIVE }, + { "joy_banksensitivity", "1.0", CVAR_ARCHIVE }, }; cvar_t Config_joystick_deadzone[] = { - { "joy_forwardthreshold", "0.16", 1 }, - { "joy_pitchthreshold", "0.08", 1 }, - { "joy_sidethreshold", "0.08", 1 }, - { "joy_yawthreshold", "0.08", 1 }, - { "joy_upthreshold", "0.08", 1 }, - { "joy_bankthreshold", "0.08", 1 }, + { "joy_forwardthreshold", "0.16", CVAR_ARCHIVE }, + { "joy_pitchthreshold", "0.08", CVAR_ARCHIVE }, + { "joy_sidethreshold", "0.08", CVAR_ARCHIVE }, + { "joy_yawthreshold", "0.08", CVAR_ARCHIVE }, + { "joy_upthreshold", "0.08", CVAR_ARCHIVE }, + { "joy_bankthreshold", "0.08", CVAR_ARCHIVE }, }; cvar_t Config_mouse_sensitivity[] = { - { "m_forward", "1.0", 1 }, - { "m_pitch", "1.0", 1 }, - { "m_side", "1.0", 1 }, - { "m_yaw", "1.0", 1 }, - { "m_up", "1.0", 1 }, - { "m_bank", "1.0", 1 }, + { "m_forward", "1.0", CVAR_ARCHIVE }, + { "m_pitch", "1.0", CVAR_ARCHIVE }, + { "m_side", "1.0", CVAR_ARCHIVE }, + { "m_yaw", "1.0", CVAR_ARCHIVE }, + { "m_up", "1.0", CVAR_ARCHIVE }, + { "m_bank", "1.0", CVAR_ARCHIVE }, }; -cvar_t Config_joystick_min = { "JoystickMin", "0,0,0,0", 1 }; -cvar_t Config_joystick_max = { "JoystickMax", "0,0,0,0", 1 }; -cvar_t Config_joystick_cen = { "JoystickCen", "0,0,0,0", 1 }; -cvar_t config_last_player = { "LastPlayer", "", 1 }; -cvar_t config_last_mission = { "LastMission", "", 1 }; -cvar_t Config_vr_type = { "VR_type", "0", 1 }; -cvar_t Config_vr_resolution = { "VR_resolution", "0", 1 }; -cvar_t Config_vr_tracking = { "VR_tracking", "0", 1 }; -cvar_t Config_primary_order = { "PrimaryOrder", "", 1 }; -cvar_t Config_secondary_order = { "SecondaryOrder", "", 1 }; -cvar_t Config_lifetime_kills = { "LifetimeKills", "0", 1 }; -cvar_t Config_lifetime_killed = { "LifetimeKilled", "0", 1 }; -cvar_t Config_lifetime_checksum = { "LifetimeChecksum", "0", 1 }; -cvar_t Config_resolution_x = { "ResolutionX", "640", 1 }; -cvar_t Config_resolution_y = { "ResolutionY", "480", 1 }; +cvar_t Config_joystick_min = { "JoystickMin", "0,0,0,0", CVAR_ARCHIVE }; +cvar_t Config_joystick_max = { "JoystickMax", "0,0,0,0", CVAR_ARCHIVE }; +cvar_t Config_joystick_cen = { "JoystickCen", "0,0,0,0", CVAR_ARCHIVE }; +cvar_t config_last_player = { "LastPlayer", "", CVAR_ARCHIVE }; +cvar_t config_last_mission = { "LastMission", "", CVAR_ARCHIVE }; +cvar_t Config_vr_type = { "VR_type", "0", CVAR_ARCHIVE }; +cvar_t Config_vr_resolution = { "VR_resolution", "0", CVAR_ARCHIVE }; +cvar_t Config_vr_tracking = { "VR_tracking", "0", CVAR_ARCHIVE }; +cvar_t Config_primary_order = { "PrimaryOrder", "", CVAR_ARCHIVE }; +cvar_t Config_secondary_order = { "SecondaryOrder", "", CVAR_ARCHIVE }; +cvar_t Config_lifetime_kills = { "LifetimeKills", "0", CVAR_ARCHIVE }; +cvar_t Config_lifetime_killed = { "LifetimeKilled", "0", CVAR_ARCHIVE }; +cvar_t Config_lifetime_checksum = { "LifetimeChecksum", "0", CVAR_ARCHIVE }; +cvar_t Config_resolution_x = { "ResolutionX", "640", CVAR_ARCHIVE }; +cvar_t Config_resolution_y = { "ResolutionY", "480", CVAR_ARCHIVE }; #define _CRYSTAL_LAKE_8_ST 0xe201 diff --git a/main/console.c b/main/console.c index 8a851375..66864766 100644 --- a/main/console.c +++ b/main/console.c @@ -43,7 +43,7 @@ int isvga(); /* How discriminating we are about which messages are displayed */ -cvar_t con_threshold = {"con_threshold", "0",}; +cvar_t con_threshold = { "con_threshold", "0", CVAR_NONE }; #define CON_BG_HIRES (cfexist("scoresb.pcx")?"scoresb.pcx":"scores.pcx") #define CON_BG_LORES (cfexist("scores.pcx")?"scores.pcx":"scoresb.pcx") // Mac datafiles only have scoresb.pcx diff --git a/main/cvar.c b/main/cvar.c index eccdc6a1..22ffcc1c 100644 --- a/main/cvar.c +++ b/main/cvar.c @@ -167,6 +167,7 @@ void cvar_set_cvarf(cvar_t *cvar, const char *fmt, ...) void cvar_set(char *cvar_name, char *value) { cvar_t *cvar; + extern cvar_t Cheats_enabled; cvar = cvar_find(cvar_name); if (!cvar) { @@ -175,6 +176,12 @@ void cvar_set(char *cvar_name, char *value) return; } + if (cvar->flags & CVAR_CHEAT && !Cheats_enabled.intval) + { + con_printf(CON_NORMAL, "cvar %s is cheat protected.\n", cvar_name); + return; + } + cvar_set_cvar(cvar, value); } @@ -185,6 +192,6 @@ void cvar_write(CFILE *file) int i; for (i = 0; i < Num_cvars; i++) - if (cvar_list[i]->archive) + if (cvar_list[i]->flags & CVAR_ARCHIVE) PHYSFSX_printf(file, "%s=%s\n", cvar_list[i]->name, cvar_list[i]->string); } diff --git a/main/cvar.h b/main/cvar.h index 662ea689..bdd6322b 100644 --- a/main/cvar.h +++ b/main/cvar.h @@ -7,10 +7,27 @@ #include "cfile.h" +// cvar flags +#define CVAR_NONE 0 +#define CVAR_ARCHIVE 1 // save to descent.cfg +#define CVAR_CHEAT 512 // can not be changed if cheats are disabled + +// Other examples we could implement (from quake 3, see also iconvar.h from the Source sdk.) +//#define CVAR_USERINFO 2 // sent to server on connect or change +//#define CVAR_SERVERINFO 4 // sent in response to front end requests +//#define CVAR_SYSTEMINFO 8 // these cvars will be duplicated on all clients +//#define CVAR_INIT 16 // don't allow change from console at all, but can be set from the command line +//#define CVAR_LATCH 32 // will only change when C code next does a Cvar_Get(), so it can't be changed +// // without proper initialization. modified will be set, even though the value hasn't changed yet +//#define CVAR_ROM 64 // display only, cannot be set by user at all +//#define CVAR_USER_CREATED 128 // created by a set command +//#define CVAR_TEMP 256 // can be set even when cheats are disabled, but is not archived +//#define CVAR_NORESTART 1024 // do not clear when a cvar_restart is issued + typedef struct cvar_s { char *name; char *string; - bool archive; + ushort flags; fix value; int intval; } cvar_t; diff --git a/main/escort.c b/main/escort.c index 0707eef5..794b599b 100644 --- a/main/escort.c +++ b/main/escort.c @@ -85,7 +85,7 @@ int Last_buddy_key; fix Last_buddy_message_time; char guidebot_name[GUIDEBOT_NAME_LEN+1] = "GUIDE-BOT"; -cvar_t real_guidebot_name = { "GuideBotName", "GUIDE-BOT", 1 }; +cvar_t real_guidebot_name = { "GuideBotName", "GUIDE-BOT", CVAR_ARCHIVE }; void init_buddy_for_level(void) { @@ -920,7 +920,7 @@ int time_to_visit_player(object *objp, ai_local *ailp, ai_static *aip) } int Buddy_objnum; -int Buddy_dude_cheat; +cvar_t Buddy_dude_cheat = { "BuddyDude", "0", CVAR_CHEAT }; fix Last_come_back_message_time = 0; fix Buddy_last_missile_time; @@ -1055,7 +1055,7 @@ void do_escort_frame(object *objp, fix dist_to_player, int player_visibility) } - if (Buddy_dude_cheat) + if (Buddy_dude_cheat.intval) do_buddy_dude_stuff(); if (Buddy_sorry_time + F1_0 > GameTime) { diff --git a/main/escort.h b/main/escort.h index 835560f5..74f61f0b 100644 --- a/main/escort.h +++ b/main/escort.h @@ -8,7 +8,7 @@ #ifndef _ESCORT_H #define _ESCORT_H -extern int Buddy_dude_cheat; +extern cvar_t Buddy_dude_cheat; #define GUIDEBOT_NAME_LEN 9 diff --git a/main/game.c b/main/game.c index 17f6a36e..061dbf12 100644 --- a/main/game.c +++ b/main/game.c @@ -122,18 +122,18 @@ grs_canvas VR_editor_canvas; // The canvas that the editor writes to. //do menus work in 640x480 or 320x200? //PC version sets this in main(). Mac versios is always high-res, so set to 1 here int MenuHiresAvailable = 1; //can we do highres menus? -cvar_t menu_use_game_res = { "MenuGameres", "0", 1 }; +cvar_t menu_use_game_res = { "MenuGameres", "0", CVAR_ARCHIVE }; int Debug_pause=0; //John's debugging pause system -cvar_t Cockpit_mode = { "CockpitMode", "0", 1 }; // CM_FULL_COCKPIT, see game.h for values +cvar_t Cockpit_mode = { "CockpitMode", "0", CVAR_ARCHIVE }; // CM_FULL_COCKPIT, see game.h for values int Cockpit_mode_save=-1; //set while in letterbox or rear view, or -1 int force_cockpit_redraw=0; fix oldfov; -cvar_t r_framerate = {"show_fps", "0"}; -cvar_t cg_fov = {"fov", "30"}; +cvar_t r_framerate = { "show_fps", "0", CVAR_NONE }; +cvar_t cg_fov = { "fov", "30", CVAR_NONE }; int PaletteRedAdd, PaletteGreenAdd, PaletteBlueAdd; @@ -425,8 +425,8 @@ void game_show_warning(char *s) int Game_window_x = 0; int Game_window_y = 0; -cvar_t Game_window_w = { "GameWidth", "0", 1 }; -cvar_t Game_window_h = { "GameHeight", "0", 1 }; +cvar_t Game_window_w = { "GameWidth", "0", CVAR_ARCHIVE }; +cvar_t Game_window_h = { "GameHeight", "0", CVAR_ARCHIVE }; int max_window_w = 0; int max_window_h = 0; @@ -1796,7 +1796,7 @@ int gr_renderstats = 0; int gr_badtexture = 0; // need to define "cheat" for badtexture -cvar_t Cheats_enabled = { "sv_cheats", "0", 0 }; +cvar_t Cheats_enabled = { "sv_cheats", "0", CVAR_NONE }; extern int Laser_rapid_fire; extern void do_lunacy_on(), do_lunacy_off(); @@ -1804,7 +1804,6 @@ extern void do_lunacy_on(), do_lunacy_off(); extern int Physics_cheat_flag,Robots_kill_robots_cheat; extern char BounceCheat,HomingCheat,OldHomingState[20]; extern char AcidCheatOn,old_IntMethod, Monster_mode; -extern int Buddy_dude_cheat; //turns off active cheats void turn_cheats_off() @@ -1821,7 +1820,7 @@ void turn_cheats_off() Interpolation_method=old_IntMethod; } - Buddy_dude_cheat = 0; + cvar_setint(&Buddy_dude_cheat, 0); BounceCheat=0; HomingCheat=0; do_lunacy_off(); @@ -2120,13 +2119,13 @@ extern int Do_appearance_effect; object *Missile_viewer=NULL; -cvar_t Missile_view_enabled = { "MissileView", "1", 1 }; +cvar_t Missile_view_enabled = { "MissileView", "1", CVAR_ARCHIVE }; int Marker_viewer_num[2]={-1,-1}; int Coop_view_player[2]={-1,-1}; cvar_t Cockpit_3d_view[2] = { - { "CockpitViewLeft", "0", 1 }, - { "CockpitViewRight", "0", 1 }, + { "CockpitViewLeft", "0", CVAR_ARCHIVE }, + { "CockpitViewRight", "0", CVAR_ARCHIVE }, }; //returns ptr to escort robot, or NULL diff --git a/main/gamecntl.c b/main/gamecntl.c index 61ec02b6..097e2059 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -1957,8 +1957,8 @@ static void gamecntl_cmd_BuddyDudeCheat(int argc, char **argv) return; do_cheat_penalty(); - Buddy_dude_cheat = !Buddy_dude_cheat; - if (Buddy_dude_cheat) + cvar_toggle(&Buddy_dude_cheat); + if (Buddy_dude_cheat.intval) { HUD_init_message("%s gets angry!", guidebot_name); strcpy(guidebot_name, "Wingnut"); @@ -2824,4 +2824,6 @@ void gamecntl_init(void) cmd_addcommand(Cheats[i].string, Cheats[i].cheat_cmd, ""); cmd_addcommand("kill", gamecntl_cmd_kill, ""); + + cvar_registervariable(&Buddy_dude_cheat); } diff --git a/main/gameseq.c b/main/gameseq.c index 7de963a9..bea7dcb7 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -78,7 +78,7 @@ int Player_num = 0; // The player number who is on the console. player Players[MAX_PLAYERS+4]; // Misc player info obj_position Player_init[MAX_PLAYERS]; -cvar_t Player_highest_level = { "HighestLevel", "0", 0 }; +cvar_t Player_highest_level = { "HighestLevel", "0", CVAR_NONE }; // Global variables telling what sort of game we have int MaxNumNetPlayers = -1; diff --git a/main/gauges.c b/main/gauges.c index 11b1d598..1056afb0 100644 --- a/main/gauges.c +++ b/main/gauges.c @@ -48,7 +48,7 @@ grs_canvas *Canv_RightEnergyGauge = NULL; grs_canvas *Canv_NumericalGauge = NULL; //Flags for gauges/hud stuff -cvar_t Reticle_on = { "crosshair", "1", 1 }; +cvar_t Reticle_on = { "crosshair", "1", CVAR_ARCHIVE }; //bitmap numbers for gauges diff --git a/main/menu.c b/main/menu.c index 790293b2..5d2bc626 100644 --- a/main/menu.c +++ b/main/menu.c @@ -104,9 +104,9 @@ void do_sound_menu(); void do_toggles_menu(); ubyte do_auto_demo = 1; // Flag used to enable auto demo starting in main menu. -cvar_t Player_default_difficulty = { "skill", "1", 1 }; // Last difficulty level chosen by the player -cvar_t Auto_leveling_on = { "AutoLeveling", "1", 1 }; -cvar_t Guided_in_big_window = { "GuidedBig", "0", 1 }; +cvar_t Player_default_difficulty = { "skill", "1", CVAR_ARCHIVE }; // Last difficulty level chosen by the player +cvar_t Auto_leveling_on = { "AutoLeveling", "1", CVAR_ARCHIVE }; +cvar_t Guided_in_big_window = { "GuidedBig", "0", CVAR_ARCHIVE }; int Menu_draw_copyright = 0; int EscortHotKeys=1; diff --git a/main/movie.c b/main/movie.c index b55f695c..9359a546 100644 --- a/main/movie.c +++ b/main/movie.c @@ -71,7 +71,7 @@ char movielib_files[4][FILENAME_LEN] = {"intro","other","robots"}; #define N_BUILTIN_MOVIE_LIBS (N_MOVIE_LIBS - 1) #define EXTRA_ROBOT_LIB N_BUILTIN_MOVIE_LIBS -cvar_t MovieHires = { "MovieHires", "1", 1 }; //default is highres +cvar_t MovieHires = { "MovieHires", "1", CVAR_ARCHIVE }; // default is highres SDL_RWops *RoboFile = NULL; MVE_videoSpec MVESpec; diff --git a/main/multi.c b/main/multi.c index c7840d04..12358a26 100644 --- a/main/multi.c +++ b/main/multi.c @@ -111,10 +111,10 @@ int Network_laser_level; // What level short Network_laser_track; // Who is it tracking? char Network_message[MAX_MESSAGE_LEN]; cvar_t Network_message_macro[4] = { - { "TauntMacro1", "", 1 }, - { "TauntMacro2", "", 1 }, - { "TauntMacro3", "", 1 }, - { "TauntMacro4", "", 1 }, + { "TauntMacro1", "", CVAR_ARCHIVE }, + { "TauntMacro2", "", CVAR_ARCHIVE }, + { "TauntMacro3", "", CVAR_ARCHIVE }, + { "TauntMacro4", "", CVAR_ARCHIVE }, }; int Network_message_reciever=-1; int sorted_kills[MAX_NUM_NET_PLAYERS]; diff --git a/main/powerup.c b/main/powerup.c index f8da9c2a..c7f5123c 100644 --- a/main/powerup.c +++ b/main/powerup.c @@ -242,7 +242,7 @@ extern void invalidate_escort_goal(void); extern void check_to_use_primary(int); extern void multi_send_got_flag (char); -cvar_t Headlight_active_default = { "HeadlightActive", "1", 1 }; // is headlight on when picked up? +cvar_t Headlight_active_default = { "HeadlightActive", "1", CVAR_ARCHIVE }; // is headlight on when picked up? extern int PlayerMessage; // returns true if powerup consumed diff --git a/main/songs.c b/main/songs.c index 5c7550dd..25568df4 100644 --- a/main/songs.c +++ b/main/songs.c @@ -46,7 +46,7 @@ int Num_songs; extern void digi_stop_current_song(); -cvar_t Redbook_enabled = { "RedbookEnabled", "1", 1 }; +cvar_t Redbook_enabled = { "RedbookEnabled", "1", CVAR_ARCHIVE }; //0 if redbook is no playing, else the track number int Redbook_playing = 0; -- 2.39.2